[REQ] Component to layer
-
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:
- Create a seperate layer for each component.
- Give the layer the same name as the component.
- Put each component on it's layer.
- Create a second layer for each component giving it the name of "Sizes " + the component name.
- Create a scene for each component where the only layer enabled is the component's layer and the "Sizes" layer.
-
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 ????
-
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.
- Layer 0
- A layer for each component.
- A second layer for each component to show the measurements.
You also end up with 6 scenes
- Scene 1, all component layers are enabled showing the entire model. The measurements layers are disabled.
- 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.
-
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.
-
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. -
@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:
- Read the components and their names. (eg Leg, Drawer side, etc)
- Create a layer with the same name as the first component. (A layer called "Leg")
- Move any component with that name to the newly created layer. (All "Leg" components get moved to the "Leg" layer)
- Create a second layer, the name is the same as the first component + "- sizes" (A layer called "Leg - sizes")
- Repeat for all components.
- Create a "Scene 1" if it does not exist already.
- Disable all the "sizes" layers for Scene 1.
- Create a scene with the same name as the first component. (A scene called "Leg" is created)
- 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")
- 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.
-
@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 -
So there is no Ruby God willing to fix this for me?... dam... "$sudo apt-get install ruby-full"
-
-
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 :
- Read the components and their names.
- Create a layer : the name is the same as the first component + "- sizes" (A layer called "Leg - sizes")
- Repeat for all components.
- Create a "Scene 1" if it does not exist already.
- Create a scene with the same name as the first component. (A scene called "Leg" is created)
- Repeat for all components.
Advertisement