Is it possible to select an object for reading in an XRef? If so could someone post an example?
Thanks
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.
Solved by chiefbraincloud. 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(PrNestOps) 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
No problem...
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.
Good advice, I've been using it on Sold3D objects with great success so far.
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.