AnsweredAssumed Answered

Selecting a curve endpoint in a macro

Question asked by Brandon Liatys on May 25, 2019
Latest reply on Jan 8, 2020 by Harold Black

I'm trying to select the endpoint of a curve in solidworks so I can create a plane on the end of the curve through a macro. This code works, but only on the one line I've recorded it on. When I use a different curve, it does not work because it seems like its selecting the point through an absolute coordinate rather then the actual endpoint of the line:


boolstatus = Part.Extension.SelectByID2("Curve1", "REFERENCECURVES", 0, 0, 0, True, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByID2("Unknown", "POINTREF", 0.6848941344, 0.5762970694, -0.1030115796, True, 1, Nothing, 0)
Dim myRefPlane As Object
Set myRefPlane = Part.FeatureManager.InsertRefPlane(2, 0, 4, 0, 0, 0)
Part.ClearSelection2 True


How can I change the second line to actually select the endpoint rather then use those absolute coordinates? The endpoint is on "Curve1" as well.