how to use the new selection ^] in macros?

how to use the new selection ^] in macros?

andrea_ricciNMVSG
Contributor Contributor
749 Views
5 Replies
Message 1 of 6

how to use the new selection ^] in macros?

andrea_ricciNMVSG
Contributor
Contributor

I noticed that from 2003 there's a new special character available in macros, ^] that 

Prompts the user to select objects, if no objects are already selected. The selected objects are assigned to the Previous selection set. Use the Previous selection option at the Select objects prompt to use the selected objects. Equivalent to ._SELECT;$M=$(if,$(eq,$(getvar,cmdnames),SELECT),\,)

from https://help.autodesk.com/view/OARX/2024/ENU/?guid=GUID-DDDB6E26-75E1-4643-8C6A-BEAEBA83A424

I'm trying to use in an old macro of mine that changes the selected objects to "byobject", with no success. The original needs to make a selection before the command:

 

^C^Cselect \change previous ;p;c;byblock;e;0;la;0;lt;byblock;s;1;lw;byblock;t;0;pl;byblock;;

 

How can I convert it to use ^] becoming able to use a previous selection OR a new one?

I tested different codes with no luck, suc as

 

^C^C_change;^]p;c;byblock;e;0;la;0;lt;byblock;s;1;lw;byblock;t;0;;

 

I don't even know if it requires a space or ; after. I can't find samples.

Thank you

0 Likes
Accepted solutions (2)
750 Views
5 Replies
Replies (5)
Message 2 of 6

Paul_Gander
Advocate
Advocate
Accepted solution

Here is a simple example to play with:

^C^C^]_move;_previous;;_none;0,0;_none;100,0

^] replaces select;\ in your first macro.

0 Likes
Message 3 of 6

komondormrex
Mentor
Mentor
Accepted solution

hey there,

check this

^C^C^];^Cchange;p;;p;c;byblock;e;0;la;0;lt;byblock;t;0;;

except for the pl keyword, which does not belong to autocad.

0 Likes
Message 4 of 6

Sea-Haven
Mentor
Mentor

You can use lisp in say pop menu's 

 

^c^c(command "chprop" (ssget) "" "c" "byblock" .............)

I find it easier some times as dont skip enter's needed. 

0 Likes
Message 5 of 6

andrea_ricciNMVSG
Contributor
Contributor

thank you, I extended it to other properties:
^C^C^];^Cchange;p;;p;c byblock;e 0;la 0;lt byblock;s 1;lw byblock;t 0;tr byblock;m byblock;;
and fyi pl is PLOTSTYLE for stb based files.

Message 6 of 6

komondormrex
Mentor
Mentor

you may also silence it with ^Q

^C^C^];^C^Qchange;p;;p;c byblock;e 0;la 0;lt byblock;s 1;lw byblock;t 0;tr byblock;m byblock;;