Select last but one...how?

Hi,
V5
What command to select last but one selection ?

I keep coming across this need.

Cheers

Steve

Sorry, I need a more complete description.
There is a SelLast command and I assume you already found that.

There are a ton of selection commands.
To get the list, type “Sel” and browse through the auto-complete list.

If you don’t find what you need there, please reply back with a better description.
Thanks

I think he wants SelNextToLast… unfortunately it does not exist… --Mitch

I guess I’d need to understand the work-flow to understand the need.

So draw a circle, then draw a line. Run this hypothetical “SelPenultimate” tool and the circle would be selected?

Probably a list of the last X number created objects is possible, analogous to UndoMultiple- you pick from the list.

-Pascal

That’s eminently scriptable with FirstObject()/NextObject(), but is it the last created objects he wants or the last selection set?

–Mitch

undoselecet would be nice

? UndoSelected is already a command.

I mean undo affecting the selection set, not the selected objects.

If memory serves me TSplines puts the selection movements on the undo stack.

edit: I checked, TSplines adds selection sets, not selecting undo. Photoshop has selecting in the undo stack.

Hi,
V5

I need to select last but one, not the last object selected but the one selected before that .
dont know how else to say it,

I shall explain further…this is just one example

  1. select an object and copy in place
  2. ctrl F …my keybd shortcut to select last created object, as I have discovered its not the one in yellow !
  3. move it somewhere and allocate it to a different layer
  4. now to find amongst the many that were all in line one behind the other the one I had selected before making that copy.

Steve

If History is enabled - Select Parent will work

The command that you want is called SelPrev

The problem is SelPrev tends to be buggy and not very effective.
If you copy and object and then immediately run selprev , it will select the original.
If you then run sellast the selection will switch to the copy.
However if you run sellast before you run selprev then selprev will no longer select the original object that was copied.
This looks like a bug to me. If it is designed behavior - its stupid and counter-productive.

Hi,
thats what I need but I would be running sellast before selPrev so if its bugged its not of use.

Guess this is a case for debugging, Can someone add it to the debugging list ?

Any other solution, I wouldnt be running history.

Steve

Is there a command, alias combo, or easy way to select all objects that result from an array command including the original input object for the array command?

This comes up for me often when creating a linear array or polar array of extrusions that will serve as input for a boolean difference operation for a bolt pattern or other repeating hole pattern in a part.

Ideally I would like a command that selects the last objects created from the array command “sellast” PLUS the initial input object(s) to the array command. Both the original and arrayed objects will need to be used by the boolean difference command.

It’s not really a big deal if there was only one object arrayed but if there where several objects arrayed over a large span in the model it becomes more tedious to select.

I could just use layer management to make this selection but most times the arrayed parts are throwaway parts used just for the one boolean difference operation in the case of bolt holes. It seems unnecessary to create a layer just for the throwaway parts.

Thoughts ideas? Thanks-QB

Yeah, this has always annoyed me, I know it follows the strict logic of “Select the last created objects” but 99 times out of 100, one wants to select the whole array including the original(s). SelPrev does not help in this case either.

The only way this works is to first set up SelLast to not deselect the previous selection (use the - version of -SelLast to set it to DeselectOthersBeforeSelect=No), then preselect the objects before calling Array. that way with SelLast, the originals will remain selected.

Otherwise this type of thing can be scripted…

import rhinoscriptsyntax as rs
orig_objs=rs.GetObjects("Select objects to array",preselect=True,select=True)
if orig_objs:
    rs.Command("Array")
    if rs.LastCommandResult()==0:
        lco=rs.LastCreatedObjects(True)

Thanks Helvetosaur! I forget about the “-” prefix version of commands with the “hidden options”

Just out of curiosity are there other frequently used commands that befit from the “-” prefix? At least in your workflows?

Thanks-QB