how to use the new selection ^] in macros?

how to use the new selection ^] in macros?

andrea_ricciNMVSG
Contributor Contributor
752件の閲覧回数
5件の返信
メッセージ1/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 件のいいね
解決済み
753件の閲覧回数
5件の返信
返信 (5)
メッセージ2/6

Paul_Gander
Advocate
Advocate
解決済み

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 件のいいね
メッセージ3/6

komondormrex
Mentor
Mentor
解決済み

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 件のいいね
メッセージ4/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 件のいいね
メッセージ5/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.

メッセージ6/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;;