.NET

Reply
Contributor
Posts: 17
Registered: ‎06-19-2012
Message 1 of 4 (189 Views)

Counting Xrefs

189 Views, 3 Replies
06-27-2012 08:33 AM

Hello,

 

I would like to know one thing, if a have a drawing named dwgtest, and i've added another drawing as xref named dwgtestxref. So the number of xnodes in the xgraph of the dwgtest would be 2 right?  the dwgtest itself and the xref

 

But if the dwgtestxref has two xrefs named dwgtestxrefxref1 and dwgtestxrefxref2. Why the number of xnodes in the xgraph of the dwgtest is 4? Shouldn't be 2? And the number of xnodes in the xgraph of the dwgtestxref would be 3, the dwgtestxref itself and his 2 xrefs.

 

I'm asking this because I'm updating the path of the xref, and I update for the dwgtestxref the two path of his xrefs, and then when I'm with the dwgtest i get 4 xnodes, and last two i get an eWasErased, that refer to the dwgtestxrefxref1 and dwgtestxrefxref2.

Am I doing something wrong? Do you understand my problem? I know it can be confusing :smileyindifferent:

 

Thanks and kind regards,

Diogo

Distinguished Contributor
Artvegas
Posts: 104
Registered: ‎04-21-2011
Message 2 of 4 (162 Views)

Re: Counting Xrefs

07-01-2012 09:34 AM in reply to: DiogoSantos

According to the ObjectARX docs:
"The host drawing is always the rootNode"

 

The xgraph includes the drawing itself and all xrefs, including xrefs nested within xrefs.

 

So 4 xnodes makes sense. One node each for:
- dwgtest
- dwgtestxref
- dwgtestxrefxref1
- dwgtestxrefxref2

 

Let's say that you have this:
- dwgA xrefed into dwgB
- dwgA xrefed into dwgC
- dwgB and dwgC xrefed into dwgD

Then you'd also have 4 xnodes.

 

It might be worth looking at the code in the following post which will list the structure of the graph:
http://adndevblog.typepad.com/autocad/2012/06/finding-all-xrefs-in-the-current-database-using-cnet.h...

 

Art

 

Active Contributor
Posts: 45
Registered: ‎09-04-2012
Message 3 of 4 (106 Views)

Re: Counting Xrefs

01-30-2013 12:03 PM in reply to: DiogoSantos

Would it be true to say that the type of graph AutoCAD uses always leaves 2 empth nodes, right and left?

ADN Support Specialist
Balaji_Ram
Posts: 609
Registered: ‎03-21-2011
Message 4 of 4 (83 Views)

Re: Counting Xrefs

02-01-2013 09:22 AM in reply to: DouceDeux

Can you please clarify what you mean by "always 2 empty nodes right and left ?"

 

You can try running the sample code from the blog post that Art has mentioned in his reply or the sample code from

http://adndevblog.typepad.com/autocad/2012/08/analysing-nested-xref-in-drawings.html

 

This can help in understanding the layout of the Xref graph.



Balaji
Developer Technical Services
Autodesk Developer Network

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community