Print Page | Close Window

code for commands

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DXF formats, Design Review, AutoCAD web, Drive, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=7973
Printed Date: 09.Jun.2026 at 19:36


Topic: code for commands
Posted By: Arthurengineer
Subject: code for commands
Date Posted: 13.Jun.2012 at 14:31
Hello all,
I have been trying to integrate three commands with one custom button. 
I have assigned the following to the button     _zoom _e ^C^C_saveas     This gives me  zoom extents followed by the save as dialogue box. 
In 2007 LT I managed to have the purge command thrown in as well.
I am now running Inventor LT 2012, mainly the LT side with our large legacy of 2D drawings whilst I find my way around the Inventor side.
I would like to have my old command (zoom extents, purge & save as) in LT 2012 but no matter what I try I can't get it to work. 
Any help would be appreciated.

Thanks in anticipation.


-------------
Arthur



Replies:
Posted By: John Connor
Date Posted: 13.Jun.2012 at 18:08
And where does the code fail?

-------------
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>



Posted By: Arthurengineer
Date Posted: 14.Jun.2012 at 09:06
The code above works ok,  but where do I add the purge command to the line?...Is it .....  purge_zoom _e ^C^C_saveas  ? 
I tried all positions but to no avail. I must be doing something fundamentally wrong....as you may see I am very much a beginner to any kind of programming although I do like to experiment.


-------------
Arthur


Posted By: John Connor
Date Posted: 14.Jun.2012 at 11:50
I notice that you haven't set an option for the Purge command.  In the macro I use I first purge all Regapps then do a second Purge using the "All" option followed by an AUDIT to fix any errors before finally saving.

-------------
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>



Posted By: Arthurengineer
Date Posted: 14.Jun.2012 at 12:01
Ok, could advise me as to set up a macro that would do a purge all, audit, zoom extents and save as as one command? perhaps I could see where I am going wrong.
Thanks....confused...


-------------
Arthur


Posted By: John Connor
Date Posted: 14.Jun.2012 at 12:19
This macro should work.  I substituted a "qsave" for "saveas".

^C^C_ze audit y _purge a * n _qsave

-------------
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>



Posted By: Arthurengineer
Date Posted: 14.Jun.2012 at 12:36
I shall try this, Thanks for your help.
Most appreciated 


-------------
Arthur



Print Page | Close Window