johnengineer Posted January 27, 2009 Share Posted January 27, 2009 I would like to create a macro using the "change" command. I would like to have it change the objects I select to bylayer color. How can I achieve this with the control characters used in macros? Quote Link to comment Share on other sites More sharing options...
CarlB Posted January 27, 2009 Share Posted January 27, 2009 ^C^CSELECT\CHPROP;P;;C;;; The select at the beginning allows user to select using various methods. The "chprop" command then calls the "previous" selection, changes "Color" to "Bylayer" (the default) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 27, 2009 Share Posted January 27, 2009 Carl, you seem to know quite a bit about macros - I have a quick question: What is the purpose of "^C^C" Thanks Quote Link to comment Share on other sites More sharing options...
GhostRider Posted January 27, 2009 Share Posted January 27, 2009 Lee, this is what I've read about the start of a macro: "Cancel Running Commands Make sure that you have no AutoCAD commands in progress before you execute a macro. To automatically cancel a command before executing a macro, enter ^C^C at the beginning of the macro (which is the same as pressing ESC twice). Although a single ^C cancels most commands, ^C^C is required to return to the command prompt from a dimensioning command and ^C^C^C is required based on the current option of the Layer command. ^C^C handles canceling out of most command sequences and therefore is the recommended sequence used to ensure no command is active before the macro is started." I am no expert though, I like to create alot of macros but it seems I have to do alot of trial and error to get one correct, each command seem to act different or combination of commands, CalB's didn't work for me as it is Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 27, 2009 Share Posted January 27, 2009 Thank you for the information Ghost - I understand things a lot better now. It makes sense to cancel command before starting macros - I suppose the alternative to error handling in LISP. I would be inclined to put ^C^C^C^C in front of my macro going by your post! Thanks Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 27, 2009 Share Posted January 27, 2009 Ahh, and a modification of Carl's code that may work a little better: ^C^CSELECT;\CHPROP;P;;C;BYLAYER;; Quote Link to comment Share on other sites More sharing options...
GhostRider Posted January 27, 2009 Share Posted January 27, 2009 I see now, I got the space after the select but didn't think the semi colon was needed but yes that works perfectly now.. COOL, thanks .. (one day I'll understand all this....LOL) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 27, 2009 Share Posted January 27, 2009 In my understanding, I thought that a space/semicolon/new-line all did the same thing - like in a script. But I don't work with macros, scripts much at all, so I could be wrong. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.