Select Previous

Select Previous

nbawden
Advocate Advocate
17,713 Views
11 Replies
Message 1 of 12

Select Previous

nbawden
Advocate
Advocate

I regularly use the select previous command manually (i.e. type "select" <enter>  at the command prompt then type "p" <enter><enter>) to recreate the last selection set.

 

When you run this command you are shown a highlighted preview of the previous selection set after the first <enter> after typing "p"  and after the last <enter> you are left with this active selection set (i.e. grips appear etc)

 

To speed things up I wanted to add this sequence of commands to the Shorcut Menu "Context menu for default mode" by creating a new command I called "Select Previous" with the macro ^C^Cselect;p;

 

When I run this command from the shortcut menu I get the preview highlight just like the manual method but when I then hit <enter> I am not given this previous selection set as an active selection - I am left with no selected objects at all.

 

I notice that Acad had an existing Select Previous command with the macro $M=$(if,$(getvar,cmdactive),,_select;)_p which has the exact same problem as my more basic macro when I try it.

 

Does anyone know the cause of this difference in functionality between manually typing the command and using either of the two macros?

Accepted solutions (1)
17,714 Views
11 Replies
Replies (11)
Message 2 of 12

Satoews
Advocate
Advocate
(defun c:selp (/ ss)
  (setq ss (ssget "_p"))
  (sssetfirst nil ss)
  (princ)
)

Familiar in how to load lisps? this seems to work in the way i think you want it to.

 

Just in case you don't know how load lisps, copy and paste lisp into a notepad and save it as whateveryouwant.lsp, then follow this to make it load on startup.

 

loading a lisp to the startup suite.

Shawn T
Message 3 of 12

hmsilva
Mentor
Mentor
Accepted solution

Try

 

^C^C_.pselect;_p;;

 

Hope this helps,
Henrique

EESignature

Message 4 of 12

Kent1Cooper
Consultant
Consultant

@nbawden wrote:

.... I wanted to add this sequence of commands to the Shorcut Menu ... by creating a new command I called "Select Previous" with the macro ^C^Cselect;p;

 

When I run this command from the shortcut menu I get the preview highlight just like the manual method but when I then hit <enter> I am not given this previous selection set as an active selection - I am left with no selected objects at all. ....


I also was going to suggest including the two semicolons at the end of that macro, though I'm not sure that would function any differently than having only one and then hitting Enter.

 

But another thing you can try in your macro:

^C^C(sssetfirst nil (ssget "_P"))

Kent Cooper, AIA
Message 5 of 12

ВeekeeCZ
Consultant
Consultant

@nbawden wrote:

I regularly use the select previous command manually (i.e. type "select" <enter>  at the command prompt then type "p" <enter><enter>) to recreate the last selection set.

 

When you run this command you are shown a highlighted preview of the previous selection set after the first <enter> after typing "p"  and after the last <enter> you are left with this active selection set (i.e. grips appear etc)

 

To speed things up I wanted to add this sequence of commands to the Shorcut Menu "Context menu for default mode" by creating a new command I called "Select Previous" with the macro ^C^Cselect;p;

 

When I run this command from the shortcut menu I get the preview highlight just like the manual method but when I then hit <enter> I am not given this previous selection set as an active selection - I am left with no selected objects at all.

 

I notice that Acad had an existing Select Previous command with the macro $M=$(if,$(getvar,cmdactive),,_select;)_p which has the exact same problem as my more basic macro when I try it.

 

Does anyone know the cause of this difference in functionality between manually typing the command and using either of the two macros?


Take the best of suggested:

 

$M=$(if,$(getvar,cmdactive),,_pselect;)_p;;

...you can apply the previous selection no matter where... Before the command (noun/verb selection) or inside the command (verb/noun selection)-

Message 6 of 12

nbawden
Advocate
Advocate

@hmsilva wrote:

Try

 

^C^C_.pselect;_p;;

 

Hope this helps,
Henrique


If I simply added another semi colon to the end of my macro it doesn't work - but your macro does thanks

0 Likes
Message 7 of 12

hmsilva
Mentor
Mentor

@nbawden wrote:

@hmsilva wrote:

Try

 

^C^C_.pselect;_p;;

 

Hope this helps,
Henrique


If I simply added another semi colon to the end of my macro it doesn't work - but your macro does thanks


You're welcome, nbawden!
Glad I could help

Henrique

EESignature

0 Likes
Message 8 of 12

prousseauCQJ6U
Advocate
Advocate

Gracias, Henrique.

Message 9 of 12

JJUDD_RAAE
Participant
Participant

exact same problem, this worked for me .

^C^C_.pselect;_p;;
0 Likes
Message 10 of 12

lynnetteu
Explorer
Explorer

I also used to be able to select previous objects, but not all of a sudden, the selection doesn't become editable after I hit enter. (SELECT --> P --> Enter button)

This might be a workaround:

Type the command PSELECT. At the "Select objects:" prompt, type P (for Previous) and hit enter.

(PSELECT --> P --> Enter button)

Message 11 of 12

cadffm
Consultant
Consultant

@lynnetteu 

you don't need to post this message every wherem specially not in threads where it is already answered

AND your workflow is wrong, as you can also read above,

the workflow is

PSELECT<enter>P<enter><enter>

 

Above you can see how to create a command and/or a button for Previous Highlighting

 

An more about SELECT and PSELECT i wrote to one of your other posts: HERE

Sebastian

0 Likes
Message 12 of 12

prousseauCQJ6U
Advocate
Advocate

@cadffm Hahah, let a man dream!

(I saw the other post where this guy replied to a 14 years old message :P)

0 Likes