Jump to content

Recommended Posts

Posted

Hi

 

I have taught myself a few minor things about Macros and can create small macros but i was wondering if you could answer a few questions about them

 

One thing is that i can make a macro to save a DWG as a certain name like ''temp.dwg'':

 

(^c^c_saveas temp)

 

but i am trying to find out how to do somthing like make it more dynamic ie. if i open a drawing called temp.dwg i would like it to make it save as the existing name and then ''REV 1'' as a suffix so it would be ''tempREV 1.dwg''

 

But then be able to open another drawing ''tempxyz.dwg'' and then, using the same macro, save it as ''tempxyzREV 1.dwg''

 

Any help on this subject would be really helpfull as i am just starting to understand macro's

 

thanks

 

Mike

Posted

Try something like this, using LISP

 

(setq dn (getvar "dwgname"))
(command "._saveas" "" (strcat (substr dn 1 (- (strlen dn) 4)) "REV 1"))

Posted

hmm all this talk about LISP... i have no idea what it is i only started macro's yesterday... but ok i will have a look and google it etc but thank you in advance :)

Posted

ok... have now got the idea with LISP... but how do you give it a command?

 

iv created the file exactly like what you have said but it just says:

 

Command: _appload Zone.lsp successfully loaded.

Command: ; error: malformed list on input

 

...when i try to load it... :S

 

thanks

Posted

woot! :D all done... forgot the ending bracket at the end of the command :P

 

thanks all

  • 2 weeks later...
Posted

ok now i have managed to add the ''rev1 to it... is is possable to make a LSP that can tell if it is ''rev1'' and i press the command it will save it as ''rev2''? and then ''rev3'' etc etc etc...

 

is this possable?:?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...