AutoCAD 2010/2011/2012

Reply
Active Member
bmiller
Posts: 7
Registered: ‎05-21-2008
Message 1 of 11 (1,369 Views)

File Save As default Variable

1369 Views, 10 Replies
09-21-2009 01:44 PM
We are getting ready to deploy 2010 and I am writing a script to set some of the system variables on all the installs.
We have some users with 3rd party programs that won't run in 2010 yet so we will have a few people still running 2007 and 2008. I want to set the default File Save As in my script to 2007 format but I can't seem to find a variable to modify this.
In case I wasn't clear this is the setting found in Options, under the Open and Save tab, in the File Save section.
Any help is appreciated.
*Dean Saadallah
Message 2 of 11 (1,369 Views)

Re: File Save As default Variable

09-22-2009 05:26 AM in reply to: bmiller
While you wait....

Normally, as a rule of thumb, if there is a variable associated with
anything on the OPTIONS pop-up, simply tapping the Help button while in that
tab displays all that is available.

Have you considered the more common method of sharing one basic AutoCAD
profile ARG file with all your new 2010 users instead of your script option?

--
Dean Saadallah
http://LTisACAD.blogspot.com
--
Valued Contributor
mikefradette
Posts: 67
Registered: ‎10-16-2007
Message 3 of 11 (1,369 Views)

Re: File Save As default Variable

09-22-2009 08:13 AM in reply to: bmiller
Here is some LISP we use to change settings. What it's doing is getting the current save format. If the format doesn't equal "36" (ACAD 2007), then it changes it.

This part changes the save version to 2007 format in AutoCAD 2010:

(vl-load-com)

(setq *opensave* (vla-get-opensave (vla-get-preferences (vlax-get-acad-object))))

(setq savetyp (vla-get-saveastype *opensave*))
(if (/= savetyp "36") (vla-put-saveastype *opensave* "36"))

(vlax-release-object *opensave*)
Valued Contributor
steve-NEO
Posts: 79
Registered: ‎04-29-2009
Message 4 of 11 (1,369 Views)

Re: File Save As default Variable

09-22-2009 08:16 AM in reply to: bmiller
Mike,

Do you know what the variable is to save it in 2004?

Thank you
Valued Contributor
mikefradette
Posts: 67
Registered: ‎10-16-2007
Message 5 of 11 (1,369 Views)

Re: File Save As default Variable

09-22-2009 08:24 AM in reply to: bmiller
AutoCAD Save Versions:

ACAD 2010: 48
ACAD 2007: 36
ACAD 2004: 24
ACAD 2000: 12
ACAD R14/LT98/LT97: 8
ACAD DWT (Drawing Template): 50

ACAD 2010 DXF: 49
ACAD 2007 DXF: 37
ACAD 2004 DXF: 25
ACAD 2000 DXF: 13
ACAD R12/LT2 DXF: 1
*Expert Elite*
GrantsPirate
Posts: 1,574
Registered: ‎08-15-2008
Message 6 of 11 (1,369 Views)

Re: File Save As default Variable

09-23-2009 09:24 AM in reply to: bmiller
You can use the +SaveAs command, under the Other option you can use 1 for 2007 dwg, 2 for 2004 dwg, 3 for 2000 dwg, 8 for 2007 dxf, 9 for 2004 dxf, 10 for 2000 dxf.

Hope that helps.

Info came from Ralph Grabowski's What's Inside AutoCAD 2010. upfrontezine.com
----------------------------------------------------------------------------
If something I wrote can be interpreted two ways, and one of the ways makes you sad or angry, I meant the other one.
Contributor
earl.huskamp
Posts: 18
Registered: ‎05-01-2009
Message 7 of 11 (1,369 Views)

Re: File Save As default Variable

12-03-2009 07:57 AM in reply to: bmiller
Are you sure these values are correct ?

I get an error with this code if I use 48 for 2010. 36 works for 2007, but not 48 for 2010.

(vlax-put-property (vla-get-OpenSave (vla-get-Preferences (vlxx-AcadObject))) 'SaveAsType 48)
Contributor
earl.huskamp
Posts: 18
Registered: ‎05-01-2009
Message 8 of 11 (1,369 Views)

Re: File Save As default Variable

12-03-2009 08:13 AM in reply to: bmiller
I understand how to force the SAVEAS format to AutoCAD 2007 DWG by using a value of 36 in this code,

(vl-load-com)
(vlax-put-property (vla-get-OpenSave (vla-get-Preferences (vlxx-AcadObject))) 'SaveAsType 36)

but once we get to the point that we want to save everything as 2010, how do we force the SAVEAS format back to 2010.

Someone in this thread said 48 is the value to use for 2010, but it doesn't seem to work.

If I try to use this, I get an Automation Error.

(vl-load-com)
(vl-load-com)

(setq *opensave* (vla-get-opensave (vla-get-preferences (vlax-get-acad-object))))

(setq savetyp (vla-get-saveastype *opensave*))
(if (/= savetyp "36") (vla-put-saveastype *opensave* "36"))
(setq savetyp (vla-get-saveastype *opensave*))
(if (/= savetyp "48") (vla-put-saveastype *opensave* "48"))


Command: (setq *opensave* (vla-get-opensave (vla-get-preferences (vlax-get-acad-object))))
#

Command: (vla-put-saveastype *opensave* "48")

Error: Automation Error. Invalid Argument*Cancel*

How do I force the setting to AutoCAD 2010 ?
Valued Contributor
mikefradette
Posts: 67
Registered: ‎10-16-2007
Message 9 of 11 (1,369 Views)

Re: File Save As default Variable

01-12-2010 07:12 AM in reply to: bmiller
I noticed you had (vl-load-com) twice, not that it matters, but you don't need it twice.

You also need to release the command with (vlax-release-object *opensave*), this is very important, otherwise you get automation errors.

Also, I tell my code to check the save type before it forces it to change, because if it's already right, there is no point in wasting time running through code that doesn't need to be run (this is more important when you have alot more code....).

Try this:

(vl-load-com)

(setq *opensave* (vla-get-opensave (vla-get-preferences (vlax-get-acad-object))))

(setq savetyp (vla-get-saveastype *opensave*))
(if (/= savetyp "48") (vla-put-saveastype *opensave* "48"))

(vlax-release-object *opensave*)
Product Support
Albert_Rius
Posts: 96
Registered: ‎09-27-2011
Message 10 of 11 (803 Views)

Re: File Save As default Variable

10-30-2012 09:40 AM in reply to: bmiller

Hi

 

There is another way (and easy) to force the same, it's adding this line on the acad20xxdoc.lsp

 

(setenv "DefaultFormatForSave" "36")  where 36 is the code for the format file that you want to use by default.

 

Note: this is valid for LT, full AutoCAD and also for Mac.

 


______________________________________________________________

If my post answers your question, please click the "Accept as Solution" button. This helps everyone find answers more quickly!

 



Albert Rius
Frontline Technical Support
Autodesk, Inc.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community




Connect with AutoCAD

Twitter

Facebook

Blogs

Pinterest

Youtube