jamesfear 发表于 2022-7-7 00:04:16

SELECT in macro won't sta

I'm trying to make a selectsimilar with a macro so my fellow AutoCAD 09 & 10 LT can use it. I've come up with this so far
 

^c^c_getsel;\_last;_select;_p;;
and it won't stay selected so I can then do move or delete... =[
 
 
One other this, I remember there being something you could put into your macro which hides what the macro just did in the command line???? anyone remember this

irneb 发表于 2022-7-7 00:12:29

You could use the PSelect instead of the normal Select ... that tends to leave the selected as is after the command completes.
 
The ^P hides the code from the command line.

irneb 发表于 2022-7-7 00:15:20

BTW, are you sure GetSel works on LT? That's an Express tool written in Lisp even on 2011. AFAIK it's a bit difficult to get lisp running in LT.

Tyke 发表于 2022-7-7 00:23:27

 
Not impossible, but in terms of the EULA illegal.
 
Try this in your command string:
^C^C^P_.pselect;/;_p;;

Tyke 发表于 2022-7-7 00:27:07

On second thoughts, why do you need to do it like that? You can set Objects before Command in Options > Selection Tab and it makes your macro superfluous.

irneb 发表于 2022-7-7 00:34:47

I think the OP wants to "simulate" the new Select Similar by using the old GetSel command. That asked you for one or more sample objects and then selected as previous all the objects on those layers. So without it, this whole thing doesn't make much sense.

Tyke 发表于 2022-7-7 00:39:36

Pity the OP is using AutoCAD 2009 because in 2011 they brought in a new command SELECTSIMILAR which is similar to the ET GetSel.
 

irneb 发表于 2022-7-7 00:45:34

Yep! And it's also sorry he can't use any lisp. Else he could've used something like mine over here: http://forums.augi.com/showthread.php?p=1132051#post1132051

YZ 发表于 2022-7-7 00:48:07

 
pselect does not seem to work in LT.I have never heard of this command before.
 
I also have this dilemma that I want to work on the selection set after the macro has finished, but the macro always cancels the selection.So I have to manually select the previous selection.Very tedious!
 
It works with identical key strokes in command line, but when I use this code, the objects won't stay selected:
^C^C'-LAYER LO * U PT_HEIGHT* U RL_*;;_ai_selall m 0,0 0,0 ^CSELECT;P;;;

irneb 发表于 2022-7-7 00:55:13

Why the 3 enters after the select command?
 
It's strange, but in my Vanilla 2011 both the PSelect and the Select commands work perfectly fine when I issue them manually. But the Select doesn't change the highlights when it's issued from a macro (only the PSelect does that).
 
Perhaps you could use a script file to run the select command through your macro?
页: [1] 2
查看完整版本: SELECT in macro won't sta