.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Trying to find a specific item in an XREF

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
466 Views, 2 Replies

Trying to find a specific item in an XREF

All,

 

I am wondering if there is a way to select a single entity (with the cursor) from an XREF object embedded within my current active drawing. I can use GetEntity to determine what objects are part of my xref, but I need to identify certain pieces as points of reference.

 

So if I have a large drawing of circuits (single line) and what not, I want to be able to point at a specific circuit segment and get length and width information for the line representation of that circuit line.

 

Kyle 

2 REPLIES 2
Message 2 of 3
chiefbraincloud
in reply to: Anonymous

It is unclear from your question wether you are using the Managed API or COM (or VB or C#).  If you're using COM, then I think there is a GetSubEntity in Utility.  I don't have an example that hasn't been upgraded to the Managed API.

 

If you are using the Managed API It goes like this:  (ApplicationServices and EditorInput Imported)

 

Dim PrNestOps As New PromptNestedEntityOptions("Select Xref Object:")

PrNestOps.AllowNone = False

PrNestOps.UseNonInteractivePickPoint = False

Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor

Dim PrNentRes As PromptNestedEntityResult = ed.GetNestedEntity(PrNestOps)

If PrNentRes.Status = PromptStatus.OK Then

'PrNentRes.ObjectId is the ID of the base object picked

'PrNentRes.PickedPoint =the point picked

'PrNentRes.Transform = the block transform to convert points and angles to WCS

'PrNentRes.GetContainers() returns an array of ObjectID's pointing to each container object

End If

Dave O.                                                                  Sig-Logos32.png
Message 3 of 3
Anonymous
in reply to: chiefbraincloud

Yes, I am using the Managed API (C# specifically). I will give this a shot, thank you for your response.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost