- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
a user needs to select an object. I need to know exactly where the object was clicked as I will process the segment the user clicked on.
Now, so far I'm using editor.GetSelection(). In most cases the user should only select one single object - and I havent figured out how to limit the selection process to exactly one object.
But there is also Editor.GetEntity() - which seems a better choice for my use case. Now, here is the question:
with GetSelection I get the point where the user clicked with the following code:
foreach (SelectedObject ssobj in selSet)
{
// usually AC Object
if (ssobj.SelectionMethod == SelectionMethod.PickPoint)
{
PickPointSelectedObject ppsd = ssobj as PickPointSelectedObject;
PickPointDescriptor ppd = ppsd.PickPoint;
p = ppd.PointOnLine;
UtilCadActive.WriteMessage("\nCAD->" + ppd.PointOnLine.ToString());
break;
}
// usually Map-FDO Object
if (ssobj.SelectionMethod == SelectionMethod.SubEntity)
{
SelectedSubObject[] subOb = ssobj.GetSubentities();
foreach (SelectedSubObject o in subOb)
{
if (o.SelectionMethod == SelectionMethod.PickPoint)
{
PickPointSelectedSubObject so = o as PickPointSelectedSubObject;
PickPointDescriptor ppd = so.PickPoint;
p = ppd.PointOnLine;
UtilCadActive.WriteMessage("\nMap->" + ppd.PointOnLine.ToString());
break;
}
}
break;
}
I have to deal with CAD entities and Map objects (FDO features). The way to get the pickpoint is different. Is there something similiar for GetEntity()? I only see PromptEntityResult.PickedPoint - how would I get to the Subentities and their PickPoint?
Thanks, Rob
Solved! Go to Solution.