Macro to freeze certain layers, then align command and then thaw those layers

Macro to freeze certain layers, then align command and then thaw those layers

Anonymous
Not applicable
1,421 Views
10 Replies
Message 1 of 11

Macro to freeze certain layers, then align command and then thaw those layers

Anonymous
Not applicable

Hello,

I'm using 2013 OEM version.

I want to thaw the information layer, use the align command then by choosing 2 points only, and freeze the informations layaer again. I know you have to use "\" to wait for user input, but I can't figure out how. Can any body help? And Merry Christmas by the way :).

 

^C^C-layer;t;_INFORMATION;;_align;all;-layer;f;_INFORMATION;;

 

0 Likes
Accepted solutions (4)
1,422 Views
10 Replies
Replies (10)
Message 2 of 11

dbhunia
Advisor
Advisor

@Anonymous wrote:

Hello,

I'm using 2013 OEM version.

I want to thaw the information layer, use the align command then by choosing 2 points only, and freeze the informations layaer again. I know you have to use "\" to wait for user input, but I can't figure out how. Can any body help? And Merry Christmas by the way :).

 

..............................

 Try this ....... Due to this two "\\" you can "Specify first source point:" and "Specify first destination point:" (two input)...... Hopefully you can manage the rest.......

 

^C^C-layer;t;_INFORMATION;;_align;all;;\\;-layer;f;_INFORMATION;;

 

Try this ....... For "Specify first source point:", "Specify first destination point:", "Specify second source point:","Specify second destination point:" and "Scale objects based on alignment points? [Yes/No] <N>: n"...... 

 

^C^C-layer;t;_INFORMATION;;_align;all;;\\\\;n;-layer;f;_INFORMATION;;

Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 3 of 11

Moshe-A
Mentor
Mentor
Accepted solution

@Anonymous hi,

 

^C^CLayer thaw _information;;align all;;\\\\;;Layer freeze _information;;

 

by the way:

when layer command is coming from menu macro it runs from command line so there is no need to call it as -layer

 

moshe

 

0 Likes
Message 4 of 11

Anonymous
Not applicable
Accepted solution

Hello,

 

Well that's what I thought to write the macro as well, but it did not work.

I opened the command line window and did the follownig tweak. This one works. Thank you!

 

^C^C-layer;t;_INFORMATION;;_align;all;;\\\\;;n;-layer;f;_INFORMATION;;

 

0 Likes
Message 5 of 11

Anonymous
Not applicable
Accepted solution

Would this work too?

I want to change the user input of the destionation points to a known point.

 

So:

;\\\\;

would change into

;\ 0,0,0 \ 6000,0,0;

 

In the command window when I input 0,0,0 manually, it returns @0,0,0

Going to try it now.

0 Likes
Message 6 of 11

Anonymous
Not applicable
Accepted solution

IT WORKS!

0 Likes
Message 7 of 11

dbhunia
Advisor
Advisor

It's good you have got your solution.......

 

But when I am using this........(In AutoCAD 2017 & 2018)....(Here my Layer name is "1")

^C^C-layer;t;1;;_align;all;;\\\\;;n;-layer;f;1;;

I am getting this "Unknown command "N".  Press F1 for help.".......

Capture.PNG

 

 

But when I am using this........(In AutoCAD 2017 & 2018)....(Here my Layer name is "1")

^C^C-layer;t;1;;_align;all;;\\\\;n;-layer;f;1;;

I am getting this.....

Capture.PNG


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 8 of 11

Anonymous
Not applicable

Yes, very strange.

I had to use the double ";" to get it running.

It does odd things sometimes. Don't know why either.

0 Likes
Message 9 of 11

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

....  I ... did the follownig tweak. This one works. ...

 

^C^C-layer;t;_INFORMATION;;_align;all;;\\\\;;n;-layer;f;_INFORMATION;;


 

Did that really work?  It shouldn't....  The first ; after the \\\\ would accept the default <continue> option instead of a third reference point, and the second ; would accept the default about whether to scale things, and that would complete the command.   That's why when the n comes along, it's waiting for a command name, but it doesn't know that as one.  Did you really not  get the problem in the first image in @dbhunia's Message 7?

 

Aside from that, I would suggest you also include turning on  that Layer, in case it might have been turned off in addition to [or possibly instead of] being frozen, and also unlocking it, just in case.  And depending on your version, you might also need a REGEN command after the LAYER command, to "bring to life" things on a Layer that was frozen [it seems to do so without REGEN in Acad2019, but it hasn't always done so].

Kent Cooper, AIA
0 Likes
Message 10 of 11

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... I had to use the double ";" to get it running. ....


 

That was appropriate in that portion of the code in Message 3 [two semicolons without  following them with an n and another semicolon].  I think the problem would have been from adding  n;  after  the two of them, instead of replacing the second one  with  n; .

 

BUT you don't need to spell out the n option at all -- that answer is always the default, even after you've used the command and chosen the Yes option, which it doesn't remember  [perhaps as a safeguard against unintended effects].  So just  ....align all;;\\\\;;Layer....  should work in any situation.

Kent Cooper, AIA
0 Likes
Message 11 of 11

dbhunia
Advisor
Advisor

@Kent1Cooper wrote:

@Anonymous wrote:

.... I had to use the double ";" to get it running. ....


...........

BUT you don't need to spell out the n option at all -- that answer is always the default, even after you've used the command and chosen the Yes option, which it doesn't remember  [perhaps as a safeguard against unintended effects].  So just  ....align all;;\\\\;;Layer....  should work in any situation.


 

Yes @Kent1Cooper this is the normal behavior of "ALIGN" command in AutoCAD, but @Anonymous is using "AutoCAD 2013 OEM version" and I do not know it's normal behavior that's why I suggest to use "...align;all;;\\\\;n;..." instead of "...align;all;;\\\\;;..." in my 1st post, to force the input "n" for the option "Scale objects based on alignment points? [Yes/No] <N>:", now I am sure the both syntax (with "No" options only for "Yes" the syntax should be "...align;all;;\\\\;y;...") should work perfectly after seeing @Anonymous's 4th Message.

 

And I also know that the syntax in  @Anonymous's 4th Message is not the correct one.....

 

But @Anonymous as you stated....

 

@Anonymous wrote:

Yes, very strange.

I had to use the double ";" to get it running.

It does odd things sometimes. Don't know why either.

 

For this I would like to see the "error message" and the drawing also in which you are facing problem.....

 


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes