Activate last selection

Activate last selection

Postby TNTDAVID » Sun Nov 05, 2017 7:46 pm

Hello everyone! :enlight:

Can I activate a previous selection in a method?

For example:

  • I select a piece of furniture in SketchUp.

  • I activate a method that selects handles that are sub-components.

  • Subsequently, it disables the furniture selection.

  • Another method changes the Handles.

  • Can we then reactivate the furniture selection?

If so, how should I proceed?

Thank you
0
* Nouveau !!!
Découvrez notre nouveau Plugin Click-Cuisine 2, pour créer vos cuisines 3D !
User avatar
TNTDAVID 
PluginStore Author
PluginStore Author
 

Re: Activate last selection

Postby ktkoh » Tue Nov 07, 2017 12:20 am

I am not an accomplished coder but it seem to me that if you think the user is going to need access to the sel save it as an array at the first then it can be reused.

Keith
0

ktkoh 
PluginStore Author
PluginStore Author
 

Re: Activate last selection

Postby slbaumgartner » Tue Nov 07, 2017 3:40 pm

Seems to me that ktkoh is right. Make an Array using #to_a to remember the contents of the current selection. Then later use Selection#clear! and Selection#add to put the contents of the Array back into the Selection.
0

slbaumgartner 
PluginStore Author
PluginStore Author
 

Re: Activate last selection

Postby Dan Rathbun » Wed Nov 08, 2017 5:09 pm

There might be a plugin out there called "Selection Memory" or similar.
1
    I'm not here much anymore. But a PM will fire email notifications.
    User avatar
    Dan Rathbun 
    PluginStore Author
    PluginStore Author
     

    Re: Activate last selection

    Postby TNTDAVID » Fri Nov 17, 2017 2:28 pm

    Thank you for your help! :enlight:
    I will analyze the Selection Memory Plugin and post the method if I find it.
    0
    * Nouveau !!!
    Découvrez notre nouveau Plugin Click-Cuisine 2, pour créer vos cuisines 3D !
    User avatar
    TNTDAVID 
    PluginStore Author
    PluginStore Author
     

    SketchUcation One-Liner Adverts

    by Ad Machine » 5 minutes ago



    Ad Machine 
    Robot
     



     

    Return to Developers' Forum

    Who is online

    Users browsing this forum: genccc, Google Bot and 10 guests

    Visit our sponsors: