Is it possible to select an object for reading in an XRef? If so could someone post an example?
PS I think it has something to do with Editor.SelectNestedEntity() but it is the end of a long day and I can't fathom it out
Solved! Go to Solution.
Dim PrNestOps As New PromptNestedEntityOptions("Pick Nested Entity") PrNestOps.AllowNone = False PrNestOps.UseNonInteractivePickPoint = False 'set that to true and supply a point to NonInteractivePickPoint if you want to get an entity at a known point without prompting the user Dim pner As PromptNestedEntityResult = acdocs.MdiActiveDocument.Editor.GetNestedEntity(Pr
NestOps) If pner.Status = PromptStatus.OK Then Dim nestedID As ObjectId = pner.ObjectId 'this is the id of the most deeply nested object at the picked point Dim pickpt As Point3d = pner.PickedPoint Dim ParentIds As New ObjectIdCollection(pner.GetContainers) 'this is the Ids of all the container objects '... do what you need to do End If
You should also note, if you haven't already discovered it, that if the selected object is a Polyline2d or Polyline3d type, then the "most deeply nested object" returned by pner.ObjectId will be a Vertex2d or Vertex3d object. So, in the code I have where I was looking for something that derives from Curve, I had to check for that, and get the parent of the Vertex to get the Curve I was looking for.
Also, It is appreciated, by both the answerers, and the future searchers, if you mark a post as a solution when your problem is solved.
Glad to help... And thanks for marking the solution. It's not an ego thing, I couldn't care less about my "solutions Authored" stats, it's just that I, and I'm sure other people like me, have an RSS feed of this forum, and I at least "look" at every single post. It helps if I can open a post and see that it has been solved, then I know I don't need to look at it any further, unless I intend to learn from it.
Then there is the other side, where I am am searching this forum or any other, I'm more likely to look at threads that show a solution, than threads that don't.