Hello,

I'm working on a macro that is meant to insert a line segment and then add relations to the line endpoints.

So I create a sketch segment with: Set skSegment = swModel.SketchManager.CreateLine(x1, y1, z1, x2, y2, z2)

My goal is to then get the .SketchPoint objects for both endpoints of the line segment. And the use .select4 method to select it.

I know ISketchArc has a GetStartPoint2() method that does what I'm looking for, the problem is though that I have a SketchSegment object not a SketchArc object.

I can't believe there is not a similar method for SketchSegment objects.

I'm trying to avoid using SelectByID, because even though I know the xyz location of the endpoints, there is also another sketchpoint at the same exact location of the endpoints. I'm actually trying to get the endpoints to have coincident relations with those.

Any help is appreciated,

Thank you!

There are multiple types of SketchSegments. A SketchArc is a type of SketchSegment. So is a SketchLine, SketchSpline, SketchEllipse, etc...

Dim you a SketchLine. Set it = to the SketchSegment of interest. Then you can use GetEndPoint2.

See the help for ISketchSegment.GetType.