In Polyline, we have the GetSegmentType:
public static void GetPolylineSegment(Polyline pline){
Point3d p3d;
SegmentType stype; int vn = pline.NumberOfVertices; for (int i = 0; i < vn; i++){ p3d = pline.GetPoint3dAt(i);
segmentType = pline.GetSegmentType((int)pline.GetParameterAtPoint(p3d));
if (segmentType == SegmentType.Arc) {
// find an arc segment
}
else if (segmentType == SegmentType.Line) {
// find a line segment
}
// ... } }
Polyline2d and Polyline3d doesn't have the same method, so is there a workaround to deal with ?
The Customization Forum would be better, but in the meantime....
If I understand what you're asking, one thing you can do [I know how to do it in AutoLISP, but I couldn't say whether it can be done in that programming language], that works on either lightweight or heavy Polylines, is to apply Object Snap CENTER at the pick point. If it returns anything, you've picked on an arc segment, otherwise on a line segment. Temporarily set the APERTURE System Variable to be the same size as the PICKBOX, to avoid the possibility of catching some other nearby thing that happens to have a Center.
But I would point out that there's no need to make a determination for segment type on 3DPolylines, which can't have arc segments [unless, of course, you don't know what kind of object you're picking on when you pick it, in which case the above approach will appropriately determine for a 3DPolyline that you picked on a line segment].
Can't find what you're looking for? Ask the community or share your knowledge.