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

Reading XREF tree from external exe

1 REPLY 1
Reply
Message 1 of 2
calvy
443 Views, 1 Reply

Reading XREF tree from external exe

Hi all,

I am trying to read the xref tree from a DWG by using an external exe. The app should simply open the DWG and sys-out the referenced paths and whether or not they are nested.
For this, I am using Autodesk.AutoCAD.Interop.
The problem is that I can only get a list of file dependencies (document.FileDependencies) and I can't seem to find an "isNested" value.
Is this even possible?

So far I've got:

AcadDocument document = oAcadApp.Documents.Open("Test.dwg");
foreach (AcadFileDependency o in document.FileDependencies)
{
 System.Console.Out.WriteLine(o.FullFileName);
}

There is also the option to get Blocks, but again there is no "isNested" info, only "isXref":
foreach (AcadBlock b in document.Database.Blocks)
                {
                    if (b.IsXRef)
                    {
                        ...doStuff...
                    }
                }

Any help would be very appreciated 🙂

Tags (1)
1 REPLY 1
Message 2 of 2
Balaji_Ram
in reply to: calvy

Sorry for the delay.

 

There is no COM API equivalent of the "XrefGraphNode" class.

 

AutoCAD 2013 introduced the accoreconsole.exe which can be invoked from an external exe in the background.

A .Net dll that traverses the Xref graph using the AutoCAD .Net API can be loaded in it to retrieve that information.

 

You can find more info on using the accoreconsole.exe here :

http://au.autodesk.com/?nd=class&session_id=10454

 

http://adndevblog.typepad.com/autocad/2012/04/getting-started-with-accoreconsole.html

 

 

 

 



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