wanted: Select after creation

Next
 From:  Nick (BODINI)
1793.1 
I find that I often need to select an entity immediately after creating it. Usually, this entity is within close range of many other things and can be hard to find again.

My request is for an easy way to select the last item created. Maybe holding down a key whilst creating it... or maybe a hot key to select the last created item. Maybe theres already a script that does this? Thanks.

-Nick
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  manz
1793.2 In reply to 1793.1 
Hi Nick,

Yes there is a script for selecting the last created object(s). Have a look here:- http://kyticka.webzdarma.cz/3d/moi/

Go down the list and you will find:- SelectLastCommandCreated

OR

the script is:-

script:var a = moi.command.lastCommandRevisionStart; var b = moi.command.lastCommandRevisionEnd; var objects = moi.geometryDatabase.getObjects(); for ( var i = 0; i < objects.length; ++i ) { var obj = objects.item(i); if ( obj.databaseRevision> a && obj.databaseRevision <= b ) obj.selected = true; }
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Nick (BODINI)
1793.3 In reply to 1793.2 
D'oh. I totally missed that. Thanks.

-Nick
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  manz
1793.4 In reply to 1793.3 
Hi Nick,

I just noticed with this script that it does not de-select all objects first, (you may have an object selected during the creation of the new object) so, you could actually have more than the last created object(s) selected after the script as run
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
1793.5 In reply to 1793.4 
Hi Steve, Hi Nick - if you would always like to have the created objects be the exclusively selected objects (with everything else deselected) instead of being added to the current selection, then use this script instead:
code:
script:moi.geometryDatabase.deselectAll(); var a = moi.command.lastCommandRevisionStart; var b = moi.command.lastCommandRevisionEnd; var objects = moi.geometryDatabase.getObjects(); for ( var i = 0; i < objects.length; ++i ) { var obj = objects.item(i); if ( obj.databaseRevision> a && obj.databaseRevision <= b ) obj.selected = true; }

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Nick (BODINI)
1793.6 
Thanks. :-)
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  manz
1793.7 In reply to 1793.5 
Hi Micheal,

Thanks.

It is not a script I use, but just added it on my setup to check before posting.
I did not want Nick to find out later he may be moving (or whatever) other previously selected objects after running the script. I think automatically de-selecting all before is a safer option (IMHO)


- Steve
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All