• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

Add entity to a group

Scheduled Pinned Locked Moved Developers' Forum
10 Posts 5 Posters 630 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    Didier Bur
    last edited by 15 Sept 2008, 12:57

    Hi all
    Is there a way to add an existing entity to a new group created by a script ?
    I haven't found anything that sounds like "new_group.add_entity(old_entity))...
    Thanks in advance,

    DB

    1 Reply Last reply Reply Quote 0
    • W Offline
      wikii
      last edited by 15 Sept 2008, 14:25

      entities.add_group(old_entity)

      1 Reply Last reply Reply Quote 0
      • M Offline
        Matt666
        last edited by 15 Sept 2008, 15:18

        Hi Didier !
        Perhaps create a group with existing group and entity to add, and explode the existing group inside the new...
        Tu pourrais créer un nouveau groupe avec le groupe existant et l'entité à ajouter, puis exploser l'ancien groupe ?
        Le problème est si tu veux à tout prix garder le groupe existant (genre si tu as un nom, etc...)

        sel.add groupe
        sel.add entite
        model.active_entities.add_group sel
        groupe.explode
        

        Frenglish at its best !
        My scripts

        1 Reply Last reply Reply Quote 0
        • R Offline
          RickW
          last edited by 15 Sept 2008, 15:43

          Be careful, though, as you cannot add existing entities to a nested group. The group will exist in model.entities, and not as a nested group.

          model = Sketchup.active_model
          entities = model.entities
          group1 = entities.add_group
          face = group1.entities.add_face(points) #points should be defined, of course
          
          #============================================================================
          #  the following group, while coded to be a nested group, will not be nested
          #============================================================================
          
          group2 = group1.entities.add_group(face)
          
          

          Google is aware of the situation, but I doubt we'll see a fix before v8.

          RickW
          [www.smustard.com](http://www.smustard.com)

          1 Reply Last reply Reply Quote 0
          • M Offline
            Matt666
            last edited by 15 Sept 2008, 15:50

            ❓ ❓
            What's the problem if you create a new group with existing group and the entity to add, and AFTER you exploding the existing group inside the new group ??? All entities of the exploded group are in the new group, with the entity to add ! 😄
            You don't agree ?

            Frenglish at its best !
            My scripts

            1 Reply Last reply Reply Quote 0
            • D Offline
              Didier Bur
              last edited by 15 Sept 2008, 16:04

              Hi,
              Thanks all,

              Sketchup.active_model.entities.add_group(old_entity) works 👍
              Sketchup.active_model.entities.add_group(Sketchup.active_model.selection) also works !
              Sketchup.active_model.entities.add_group([entity1,entity2,...,entityN]) works too.

              Could be put in the Wiki, because this is not mentionned in the regular doc.

              DB

              1 Reply Last reply Reply Quote 0
              • M Offline
                Matt666
                last edited by 15 Sept 2008, 16:27

                Ah ok... I have not read the question enough... 😳 😳 😳
                I understood : "Is there a way to add an existing entity to a existing group created by a script ?"

                Hum hum 😕

                Frenglish at its best !
                My scripts

                1 Reply Last reply Reply Quote 0
                • J Offline
                  Jim
                  last edited by 15 Sept 2008, 19:39

                  @didier bur said:

                  Hi,
                  Thanks all,

                  Sketchup.active_model.entities.add_group(old_entity) works 👍
                  Sketchup.active_model.entities.add_group(Sketchup.active_model.selection) also works !
                  Sketchup.active_model.entities.add_group([entity1,entity2,...,entityN]) works too.

                  Could be put in the Wiki, because this is not mentionned in the regular doc.

                  The most recent documentation has been updated. See below for a link.

                  301 Moved Permanently

                  favicon

                  (www.sketchucation.com)

                  Hi

                  1 Reply Last reply Reply Quote 0
                  • D Offline
                    Didier Bur
                    last edited by 15 Sept 2008, 21:56

                    @unknownuser said:

                    The most recent documentation has been updated

                    😳
                    Oops, apparently the problem for me isn't to know if an information exists, but to know where it is...

                    DB

                    1 Reply Last reply Reply Quote 0
                    • J Offline
                      Jim
                      last edited by 15 Sept 2008, 22:07

                      This is the documentation page I use - it's the most up-to-date:

                      http://groups.google.com/group/SketchUp-Plugins-Dev/web/Ruby-classes.html

                      Todd and Rick get all the credit for updating the docs - it's a thankless chore, no doubt.

                      I wish there was a way to see what changes have been made to the documentation. I've asked that document updates be logged for us, but maybe I'm asking too much.

                      Hi

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      1 / 1
                      • First post
                        1/10
                        Last post
                      Buy SketchPlus
                      Buy SUbD
                      Buy WrapR
                      Buy eBook
                      Buy Modelur
                      Buy Vertex Tools
                      Buy SketchCuisine
                      Buy FormFonts

                      Advertisement