AutoCAD 2010/2011/2012

Reply
Contributor
FrostPoems
Posts: 13
Registered: ‎06-27-2011
Message 1 of 6 (173 Views)

Whjy won't this little macro work

173 Views, 5 Replies
08-15-2011 08:26 AM

 

I want to replace the adopted Express command for locking a layer (and now I've forgotten that Express command's name) with a macro that launches the regular _layer command, then issues `LO' to start the regular layer command's LOck option. This is better than the Express command, because you can select more than one object at a time, in case there's a whole bunch of objects on different layers that you want to lock all at once. I did this years ago with 2007, but I'm having n o success this time. It should be very simple: ^C^C _LAYER LO  Which should launch the Layer command, issue `LO' to start its LOck option; -at that point it should be waiting for me to hit <enter>, after which it's supposed to respond with `select objects' and wait for me to window around the objects whose layers are to be locked. That's exactly the way the command works if you type -Layer at the command prompt (you don't need to precede the command with the dash when it's being issued from a menu). But what happens instead is that the layer command starts, it gets into the LOck option ok, but then it doesn't enter into the selection phase. I tried adding a ";" character, which is supposed to be the same as hitting <enter> (which is what the command waits for to start the selection process) but that seems to make no difference. And I could swear this is how I wrote the macro when it worked fine with 2007. This should be a no-brainer; what am I doing wrong?

Go Placidly Amid the Noise And Haste...
*Expert Elite*
Bob_Zurunkle
Posts: 1,029
Registered: ‎03-24-2011
Message 2 of 6 (170 Views)

Re: Whjy won't this little macro work

08-15-2011 09:06 AM in reply to: FrostPoems

Is it a backslash or something similar mebbe?

If by some odd chance my nattering was useful -- that's great, glad to help. But if it actually solved your issue, then please mark my solution as accepted :smileyhappy:
*Expert Elite*
azrdgldr
Posts: 1,250
Registered: ‎01-09-2007
Message 3 of 6 (159 Views)

Re: Whjy won't this little macro work

08-15-2011 10:50 AM in reply to: Bob_Zurunkle

Out of curiosity did you place the semicolon after LO or LO and a space:

 

"LO;" or "LO ;"

 

To clarify my ?

Contributor
FrostPoems
Posts: 13
Registered: ‎06-27-2011
Message 4 of 6 (153 Views)

Re: Whjy won't this little macro work

08-15-2011 10:54 AM in reply to: Bob_Zurunkle

No, backslash pauses a command for input. In the case of the Layer command, after hitting LO for lock, you're presented with the option of either typing a list of layer names you want locked (yeah, right, I'm gonna remember the exact spelling and name of each layer) OR (the option that makes more sense) you hit <enter>, and the command responds with "select objects:"

 

-Problem is, adding a semicolon (which means `enter') does not seem to have the effect of hitting <enter> at this point in the command; instead, it reacts as though <enter> was hit twice at that point, and goes back to the options stage of the command.
....

Go Placidly Amid the Noise And Haste...
*Expert Elite*
azrdgldr
Posts: 1,250
Registered: ‎01-09-2007
Message 5 of 6 (114 Views)

Re: Whjy won't this little macro work

08-16-2011 08:01 AM in reply to: FrostPoems

I have tried a few versions on my own separate toolbar and can't get it to work.  I thought since the Laylck command had something to do with the Layer Fade Control then there is where  the problem may lie and I was wrong.  I can make it work as a menu pulldown item in my custom menu, but toolbar no way.  I have never like dealing with the cui, so I created my own custom menu (mnu file) and just do a menuload to load it.  That way no cui interaction.

Contributor
FrostPoems
Posts: 13
Registered: ‎06-27-2011
Message 6 of 6 (104 Views)

Re: Why won't this little macro work

08-17-2011 08:03 AM in reply to: azrdgldr

I believe I've tried every possible combination of spaces and semicolons at this point. The problem seem to be related to the command requiring <enter> to be hit to advance it to the stage wherein it says `Select objects:". It seems that the semicolon, although it usually means the same thing as <enter>, does not function that way within this command. I'm going to try a simple LISP string and see if I can get it to work that way...

 

...Nope, No dice - not, at least, without having the LISP routine make its own selection set, and then trying to pass that back to the command - which, at this point, I have no reason to believe will work anyway, so I give up - not worth any more of my time. I'll just set the macro back to the comparatively stupid LAYLCK (Express tool) command.

Go Placidly Amid the Noise And Haste...

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