sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    [REQ] Component to layer

    Scheduled Pinned Locked Moved Plugins
    10 Posts 3 Posters 1.3k Views 3 Watching
    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.
    • H Offline
      Hazza
      last edited by

      I do woodworking models and to show the layout of each piece I put each component on a seperate layer and create a scene that just shows that layer.

      I would like a script that would:

      1. Create a seperate layer for each component.
      2. Give the layer the same name as the component.
      3. Put each component on it's layer.
      4. Create a second layer for each component giving it the name of "Sizes " + the component name.
      5. Create a scene for each component where the only layer enabled is the component's layer and the "Sizes" layer.

      See all of my SketchUp models here.

      1 Reply Last reply Reply Quote 0
      • M Offline
        Matt666
        last edited by

        I don't understand 4... Why creating a second layer ??? Can you show me an example of layer name (wiht "sizes")...

        I don't understand the end of 5... Components have two layers. I don't understand utility f the second... Do you want to put component dimension entities inside a layer ????

        Frenglish at its best !
        My scripts

        1 Reply Last reply Reply Quote 0
        • H Offline
          Hazza
          last edited by

          Probably best demonstrated with this model. Lets say the model has 5 components, all design and construction is done on Layer0. Once finished you run the "Components to Layers" and end up with the 11 layers.

          1. Layer 0
          2. A layer for each component.
          3. A second layer for each component to show the measurements.

          You also end up with 6 scenes

          1. Scene 1, all component layers are enabled showing the entire model. The measurements layers are disabled.
          2. A scene for each component, each components scene has 2 layers enabled, the components layer and the "Sizes layer"

          After the script has been run then the measurements for the piece could be placed on the "Measurements" layer.

          See all of my SketchUp models here.

          1 Reply Last reply Reply Quote 0
          • M Offline
            Matt666
            last edited by

            Hum... I think it's not possible to identify all dimension entities associated with an object via actual ruby. We don't have any access to dimension entities via ruby.

            So it is possible to do something to the point 3. not the point4. Also possible to create scenes with desired layers.

            Frenglish at its best !
            My scripts

            1 Reply Last reply Reply Quote 0
            • Jean-FrancoJ Offline
              Jean-Franco
              last edited by

              Bert places the measurements of each piece/component on a hidden layer which is only visible on the scene where the component is displayed.

              Bert's method is described here: http://www.viddler.com/explore/Blisee/videos/20/
              Bert did it in french.

              Jean-Franco

              1 Reply Last reply Reply Quote 0
              • H Offline
                Hazza
                last edited by

                @matt666 said:

                Hum... I think it's not possible to identify all dimension entities associated with an object via actual ruby. We don't have any access to dimension entities via ruby.

                Maybe I am not explaining myself very clearly, sorry about that. I don't want the script to place the dimensions there for me. All point 4 does is create a second hidden layer for the component. Heres the functions of the script in plain english:

                1. Read the components and their names. (eg Leg, Drawer side, etc)
                2. Create a layer with the same name as the first component. (A layer called "Leg")
                3. Move any component with that name to the newly created layer. (All "Leg" components get moved to the "Leg" layer)
                4. Create a second layer, the name is the same as the first component + "- sizes" (A layer called "Leg - sizes")
                5. Repeat for all components.
                6. Create a "Scene 1" if it does not exist already.
                7. Disable all the "sizes" layers for Scene 1.
                8. Create a scene with the same name as the first component. (A scene called "Leg" is created)
                9. For that scene disable all layers except the component and the component sizes layer. (Only the layers "Leg" and "Leg - sizes" are enabled for the scene "Leg")
                10. Repeat for all components.

                After the script has finished I would be able to change to the scene for that component and place the dimensions that I wanted to for that component on the sizes layer.

                See all of my SketchUp models here.

                1 Reply Last reply Reply Quote 0
                • H Offline
                  Hazza
                  last edited by

                  @matt666 said:

                  Hi !
                  Here is the script... πŸ˜‰ Good ?

                  So close, I have attached a test box model, try the script on that.

                  I think I am going to learn Ruby......
                  test-box.skp

                  See all of my SketchUp models here.

                  1 Reply Last reply Reply Quote 0
                  • H Offline
                    Hazza
                    last edited by

                    So there is no Ruby God willing to fix this for me?... dam... "$sudo apt-get install ruby-full"

                    See all of my SketchUp models here.

                    1 Reply Last reply Reply Quote 0
                    • M Offline
                      Matt666
                      last edited by

                      Hi !
                      Here is the script... πŸ˜‰

                      EDIT: Update the code...


                      Menu Plugins : "One page per instance"

                      Frenglish at its best !
                      My scripts

                      1 Reply Last reply Reply Quote 0
                      • M Offline
                        Matt666
                        last edited by

                        I have updated the code...
                        The procedure you wanted is not possible without problems... Pages don't always keep their active layer.

                        Here is the new procedure :

                        1. Read the components and their names.
                        2. Create a layer : the name is the same as the first component + "- sizes" (A layer called "Leg - sizes")
                        3. Repeat for all components.
                        4. Create a "Scene 1" if it does not exist already.
                        5. Create a scene with the same name as the first component. (A scene called "Leg" is created)
                        6. Repeat for all components.

                        Frenglish at its best !
                        My scripts

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

                        Advertisement