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

Counting Xrefs

3 REPLIES 3
Reply
Message 1 of 4
DiogoSantos
479 Views, 3 Replies

Counting Xrefs

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 😐

 

Thanks and kind regards,

Diogo

3 REPLIES 3
Message 2 of 4
Artvegas
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

 

Message 3 of 4
DouceDeux
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?

Message 4 of 4
Balaji_Ram
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

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