Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Active Contributor
27 Posts
0 Kudos
Registered: ‎07-09-2008
Post 1 of 6
Accepted Solution

Saveas using Lisp Or Vlisp

265 Views, 5 Replies
02-04-2013 05:12 AM

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"

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

*Expert Elite*
6,015 Posts
667 Kudos
Registered: ‎09-13-2004
Post 2 of 6

Re: Saveas using Lisp Or Vlisp

02-04-2013 05:54 AM in reply to: macuma

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

Kent Cooper
Active Contributor
27 Posts
0 Kudos
Registered: ‎07-09-2008
Post 3 of 6

Re: Saveas using Lisp Or Vlisp

02-04-2013 06:11 AM in reply to: Kent1Cooper

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

Active Contributor
27 Posts
0 Kudos
Registered: ‎07-09-2008
Post 4 of 6

Re: Saveas using Lisp Or Vlisp

02-20-2013 03:30 AM in reply to: macuma

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.

Active Contributor
27 Posts
0 Kudos
Registered: ‎07-09-2008
Post 5 of 6

Re: Saveas using Lisp Or Vlisp

02-20-2013 03:44 AM in reply to: macuma

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

*Expert Elite*
2,535 Posts
306 Kudos
Registered: ‎11-24-2009
Post 6 of 6

Re: Saveas using Lisp Or Vlisp

02-20-2013 03:46 AM in reply to: macuma

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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!