Reading a System Variable from an external drawing

Reading a System Variable from an external drawing

nick.seman
Advocate Advocate
542 Views
4 Replies
Message 1 of 5

Reading a System Variable from an external drawing

nick.seman
Advocate
Advocate

Hello:

 

I have written some code that allows the user to select a project directory through which it finds all the DWG's in the directory structure and creates a report listing each drawing's name and the names of each drawing's xreferenced files along with their insert units.  I would also like to include the insunits value for each parent drawing however I am having difficulty getting that to work.

 

I cannot use the ThisDrawing.GetVariable("InsUnits") as I never have the parent drawing open or active.  I use  AXDBLib.AxDbDocument to set a variable as the document, then look for the blocks (isxref) inside of it.  That works but apparently the object does not support the GetVariable method.

 

I have also tried setting an object equal to the drawing's database however I am not finding that I can extract system variable information that way either.

 

I apologize as I am sure I am butchering the terminology here - I am not a programmer . . .

 

I appreciate any direction you may be able to provide.  In short - I would like to extract the value of a system variable from a drawing other than the currently open drawing.

 

Thanks;

Nick

0 Likes
543 Views
4 Replies
Replies (4)
Message 2 of 5

nick.seman
Advocate
Advocate

OK - alternatively - is it impossible to extract a system variable value from a drawing that is not currently open ?

 

Thanks;

Nick

0 Likes
Message 3 of 5

Ed__Jobe
Mentor
Mentor

I haven't tried getting a var from an axDbDocument, but I don't see why you can't. Instead of using ThisDrawing, use the axDbDocument object.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 4 of 5

Ed__Jobe
Mentor
Mentor

Just did a test to confirm and you can't get a variable using AxDb.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 5 of 5

nick.seman
Advocate
Advocate

Hi Ed:

 

Thanks for checking this out and I apologize for not getting back to you after your first post.

 

I did try what you suggested and came to the same result that you did.

 

Thanks again,

Nick

 

 

0 Likes