Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Saveas using Lisp Or Vlisp

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
itmanagement
553 Views, 5 Replies

Saveas using Lisp Or Vlisp

Is it possible to call the saveas command with the dialog showing with the filename already set by a variable?

 

Have already tried (initdia)(command "saveas" "" "MyDrawing") and (initdia)(vl-cmdf "saveas" "" "MyDrawing").

 

If running from a new file the filename in the dialog is always populated as "Drawing1"

5 REPLIES 5
Message 2 of 6
Kent1Cooper
in reply to: itmanagement

Look into the (getfiled) function, which has an argument for a default file name.

Kent Cooper, AIA
Message 3 of 6
itmanagement
in reply to: Kent1Cooper

Thanks Kent. That does the trick if it can't be done direct from the command.

Message 4 of 6
itmanagement
in reply to: itmanagement

Only just got round to fully testing this. It accepts the variables but can't be used to save, only to open an existing file.

Message 5 of 6
itmanagement
in reply to: itmanagement

Sorry, this does work. Didn't read the flag settings correctly.

Message 6 of 6
pbejse
in reply to: itmanagement


@macuma wrote:

Only just got round to fully testing this. It accepts the variables but can't be used to save, only to open an existing file.


 

(setvar 'expert 5)
(setq fn (getfiled "Save drawing as" (strcat (getvar 'dwgprefix) var) "dwg" 1))
(command "_save" fn)

 

HTH

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost