AnsweredAssumed Answered

How to get line name

Question asked by Yong Ning on Jun 17, 2015
Latest reply on Jun 17, 2015 by Ivana Kolin

Record select line

Sub main()

Set SwApp = Application.SldWorks

Set Part = SwApp.ActiveDoc

Set SelMgr = Part.SelectionManager

boolstatus = Part.Extension.SelectByID2("Line1", "SKETCHSEGMENT", 0.1267650291262, 0.1770293009709, 0, False, 0, Nothing, 0)

End Sub

 

 

select line name is "Line1"

 

00.jpg

 

 

 

follow code , don't debug.print  select line name?

 

Private Sub ll()

   Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

      Set SwApp = Application.SldWorks

      Set SwModel = SwApp.ActiveDoc

   Dim SwSelMgr As SelectionMgr, Ss

      Set SwSelMgr = SwModel.SelectionManager

   Dim SwLine As ISketchLine, SwSeg As ISketchSegment

      Set SwSeg = SwSelMgr.GetSelectedObject5(1)

      Debug.Print SwSeg.GetType ', SwSeg.GetID

      Ss = SwSeg.GetID

      Set SwLine = SwSelMgr.GetSelectedObject5(1)

 

End Sub

Attachments

Outcomes