Xref Capture

Xref Capture

chris.sonon
Observer Observer
574 Views
1 Reply
Message 1 of 2

Xref Capture

chris.sonon
Observer
Observer

Hello -

 

I am new to the AutoCAD API and I am looking for some clarity/guidance. I am a c# developer and have experience working with SolidWorks API's, so my comments/questions will stem from that background.

 

  1. Does the AutoCAD API provide an interface to access External References without the need for the following:
    • Have AutoCAD installed
    • Have AutoCAD open
    • SolidWorks uses what is called a Document Manager API (I see the DocumentManager in the ApplicationServices.Application namespace but cannot get it to properly open a .dwg file).
  2. What are the interop (or other .dll) files that are required if you can deploy without AutoCAD?
    • Are they included in the API install through ObjectARX?
  3. How can the database file be opened to capture Xrefs, properly?
    • Right now I am using the following code to attempt to open a .dwg file
      • Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Open({path});
    • I receive an error that states the CLR detected an invalid program.
      • Note that the VM I am testing on does not have AutoCAD installed (currently).

 

The end goal is to be able to scan a large group of .dwg files (on any machine, with or without AutoCAD installed) and then capture their External Reference structures to be able to better visualize the depth of directory usage in large data sets.

 

Any help is greatly appreciated!

0 Likes
575 Views
1 Reply
Reply (1)
Message 2 of 2

dgorsman
Consultant
Consultant

In order to work with DWG files without AutoCAD you need to purchase a RealDWG license.  This provides a data-only interface to work on drawing files ie. no selection sets or other graphic methods, but otherwise its just like running inside AutoCAD.

 

You keep mentioning XREFs so I'll add this as well.  You can open an XREF'd drawing file inside AutoCAD as a side database ie. it doesn't open the file as it would with the regular Open, it only connects to the contents of the file.  Like the RealDWG license there is no GUI but otherwise its the same.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


0 Likes