Dim swApp As SldWorks.SldWorks Dim boolstatus As Boolean Dim longstatus As Long, longwarnings As Long Dim swModel As SldWorks.ModelDoc2 Dim swSelMgr As SldWorks.SelectionMgr Dim edgeF As SldWorks.edge Dim swSelObj() As Object Dim swSelObj2 As Object Dim SelType As Long Dim SelCount As Long Dim swEnt As SldWorks.Entity Set swApp = GetObject(, "SldWorks.Application") Set swModel = swApp.ActiveDoc Set swSelMgr = swModel.SelectionManager SelCount = swSelMgr.GetSelectedObjectCount Dim Integer1 As Integer Integer1 = 1 Dim Kanten_Punkt() As Variant ReDim Kanten_Punkt(SelCount) For i = 1 To SelCount SelType = swSelMgr.GetSelectedObjectType(i) If SwConst.swSelectType_e.swSelEDGES = SelType Then Kanten_Punkt(Integer1) = swSelMgr.GetSelectionPoint(i) Integer1 = Integer1 + 1 Set swEnt = edgeF End If Next i swModel.ClearSelection Dim Booly As Boolean Booly = False For i = 1 To Integer1 - 1 Dim Endpoint As Variant Endpoint = Kanten_Punkt(i) boolstatus = swModel.Extension.SelectByID2("", "EDGE", Endpoint(0), Endpoint(1), Endpoint(2), Booly, 1, Nothing, 0) Booly = True Next i swModel.InsertCompositeCurve