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

Open Drawing...Update Drawing...Close Saving Changes

2 REPLIES 2
Reply
Message 1 of 3
davo_007
494 Views, 2 Replies

Open Drawing...Update Drawing...Close Saving Changes

Hello People,

I am attempting to open a drawing, run a script or lisp and then save and close the drawing.

I am using the following to open the drawing:

Dim acDocMgr As DocumentCollection = Application.DocumentManager

acDocMgr.Open("C:\Users\Laptop\Documents\test1.dwg", False)

and the following the save and close the drawing:

acDocMgr.MdiActiveDocument.CloseAndSave("C:\Users\Laptop\Documents\test1.dwg")

Both the opening and closing of the drawing seem to work fine however the save does not work (but does not error with the above function).

i am attempting to run the following after the open:

acDocMgr.MdiActiveDocument.SendStringToExecute("script" & vbCr & "C:\Users\Laptop\Documents\script.scr" & vbCr, True, False, True)

where the script.scr file contains the following:

_Point
1,1,0
filedia
1

The point is created however upon save the data is not saved to the file (i even tried putting qsave in the script).

The plan is to run a lisp routine in place of the script (just trying to get the base to work at the moment) which is to update attributes already in the drawings.

From what i've read around the place (google and here) it appears that a transaction maybe required for the data to be commited to the drawing, however my question is, if the script is doing the creation how do i tell the transaction about it, and further more, if a lisp was to do the updating of the attributes, how would the transaction be told about those updates?

Or is there something else i'm missing entirely??

any push in the right direction would be appreciated.

Regards,

Davo_007

2 REPLIES 2
Message 2 of 3
jjaborni
in reply to: davo_007

hello davo_007,

[ http://through-the-interface.typepad.com/through_the_interface/2006/08/calling_command.html] will help.
Message 3 of 3
bje69
in reply to: davo_007

Want to get Changes DRAWCLOSE TO JEHOVAH How do I do this?

 

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