Jump to content

SELECT in macro won't stay selected!!!! How to hide Macro in command line aswell?


jamesfear

Recommended Posts

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

Link to comment
Share on other sites

  • 4 weeks later...

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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;; 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

AutoCAD_2011_select_similar_settings.png

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.

Link to comment
Share on other sites

  • 2 months later...

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;;;

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

  • 5 months later...

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?

Link to comment
Share on other sites

  • 4 months later...

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;;

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...