jamesfear Posted July 7, 2011 Share Posted July 7, 2011 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 Quote Link to comment Share on other sites More sharing options...
irneb Posted August 1, 2011 Share Posted August 1, 2011 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. Quote Link to comment Share on other sites More sharing options...
irneb Posted August 1, 2011 Share Posted August 1, 2011 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. Quote Link to comment Share on other sites More sharing options...
Tyke Posted August 1, 2011 Share Posted August 1, 2011 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. Not impossible, but in terms of the EULA illegal. Try this in your command string: ^C^C^P_.pselect;/;_p;; Quote Link to comment Share on other sites More sharing options...
Tyke Posted August 1, 2011 Share Posted August 1, 2011 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. Quote Link to comment Share on other sites More sharing options...
irneb Posted August 1, 2011 Share Posted August 1, 2011 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. Quote Link to comment Share on other sites More sharing options...
Tyke Posted August 1, 2011 Share Posted August 1, 2011 Pity the OP is using AutoCAD 2009 because in 2011 they brought in a new command SELECTSIMILAR which is similar to the ET GetSel. Select Similar Select similar will select all objects with similar properties. You can set how similar the objects are. By default, AutoCAD will select objects if they have the same object name and layer. You can activate this tool by typing SELECTSIMILAR [enter]. You can change the settings using this method. You can also activate this tool by noun-verb selection: select your objects then right click. You will find the ‘select similar’ in the contextual menu. This item will appear in contextual menu, only if you have object(s) in your selection set. Quote Link to comment Share on other sites More sharing options...
irneb Posted August 1, 2011 Share Posted August 1, 2011 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 Quote Link to comment Share on other sites More sharing options...
YZ Posted October 6, 2011 Share Posted October 6, 2011 Try this in your command string: ^C^C^P_.pselect;/;_p;; 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;;; Quote Link to comment Share on other sites More sharing options...
irneb Posted October 6, 2011 Share Posted October 6, 2011 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? Quote Link to comment Share on other sites More sharing options...
YZ Posted March 29, 2012 Share Posted March 29, 2012 I have learned some more on this. Still thinking about it a lot. Not sure if the OP has solved this, but it would make a huge difference if I could get it working. Why the 3 enters after the select command? If only put 1 enter after the SELECT command then the selection ends after the macro. Then I Click PSELECT button and type P and enter. My theory was that it would repeat the command and just "work". In the end the 3 enters gave the same result as 1 so I guess I just left it! 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). The default button in LT issues the PSELECT command (as opposed to SELECT), but when I type it in command line or use it in a custom macro, LT returns "Unknown Command". It seems that if the PSELECT command worked in LT then problem would be solved. But it does not, and as you say, SELECT will not leave it highlighted. Perhaps you could use a script file to run the select command through your macro? A script is an interesting idea. I have only used scripts to open and plot jobs on mass, usually calling AutoCAD to open and close each time. I have never called one from within a macro. Is it likely to be able to leave a selection set "selected" so to manually make changes to its properties before escaping the selection? Quote Link to comment Share on other sites More sharing options...
YZ Posted July 31, 2012 Share Posted July 31, 2012 I am not certain what changed, maybe my code improved, but more likely AutoCAD 2013 allowed this. In any case, this macro is in LT 2013 and the selection set stays selected after macro is finished, allowing editing on properties of selection directly. ^C^C'-LAYER;LOCK;*;UNLOCK;PT_HEIGHT*,RL_*;;_ai_selall;MOVE;0,0;0,0;SELECT;PREVIOUS;; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.