https://forum.solidworks.com/message/276272#276272
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
boolstatus = Part.ActivateView("工程视图1")
boolstatus = Part.Extension.SelectByID2("Line3", "SKETCHSEGMENT", 0.07163737162387, 0.1429636138611, 0, False, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Line4", "SKETCHSEGMENT", 0.07757188244778, 0.08955301644588, 0, True, 0, Nothing, 1)
Dim DrawView As Object
Dim ExcludedComponents As Variant
Set DrawView = Part.CreateSectionViewAt4(0.1404776971812, 0.1259513494992, 0, "B", 2, ExcludedComponents)
boolstatus = Part.ActivateView("工程视图3")
End Sub
Run "CreateSectionViewAt4", Need select Line ID, E.G."Line3","Line4"
Therefore, this Tip problem is, how to get the ID of lind. Select "Line3" and "Line4"
Thanks
SolidworksApi macros