AnsweredAssumed Answered

select Edge

Question asked by Yong Ning on Dec 28, 2016
Latest reply on Dec 30, 2016 by Yong Ning

Edge.jpg

 

 

 

 

 

Private Sub ll4()

   Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

       Set SwApp = Application.SldWorks

       Set SwModel = SwApp.ActiveDoc

   Dim SwDraw As DrawingDoc

       Set SwDraw = SwModel

   Dim SwView As View

       Set SwView = SwDraw.GetFirstView

       Set SwView = SwView.GetNextView

   Dim Pt(2) As Double

       'SwView.SetXform Pt

       SwDraw.ActivateView SwView.Name

   Dim oScale

       oScale = 1 / SwView.ScaleDecimal

       Debug.Print SwView.Name

   Dim SwSelMgr As SelectionMgr

       Set SwSelMgr = SwModel.SelectionManager

   Dim SwDispDim As DisplayDimension, SwDim As Dimension, Str

       Set SwDispDim = SwSelMgr.GetSelectedObject5(1)

       Set SwDim = SwDispDim.GetDimension

       Debug.Print SwDim.Value

      

   Dim SwAnn As Annotation, Params

       Set SwAnn = SwDispDim.GetAnnotation

       Params = SwAnn.GetPosition

       Xx = Params(0)

       Yy = Params(1) + SwDim.Value / 2000 / oScale

       tmp = SwModel.Extension.SelectByID2("", "EDGE", Xx, Yy, 0, True, 0, Nothing, 0)

       Yy = Params(1) - SwDim.Value / 2000 / oScale

       tmp = SwModel.Extension.SelectByID2("", "EDGE", Xx, Yy, 0, True, 0, Nothing, 0)

       Stop

       SwDraw.InsertCenterLine2

       Stop

End Sub

Attachments

Outcomes