Selecting all components on a given layer.
-
I am using CutListAndMaterials.rb to produce a cutting list.
This script works on 'selected' items only.
All the cabinets are in different layers called 'Base Units'/'Wall Units' etc.
I want to simplify the process of selecting the items and came across this 'script' which supposedly allows you to choose a layer from the layers in the scene and then selects everything on that layer
#This example adds a menu item to select things in the model # based on Layer or Material. The also demonstrate putting a popup list # in an input box def select_by_layer # First get a list of all of the layers in the model model = Sketchup.active_model layers = model.layers names = layers.collect {|l| l.name} # Display a dialog to pick the layer to select prompts = ["Layer"] values = [names[0]] enums = [names.join("|")] results = inputbox prompts, values, enums, "Select By Layer" return if not results # Now select everything on the selected layer layername = results[0] do_select {|e| e.layer.name == layername} end
I have no experience of Ruby Script and wondered if anyone could assist me by explaining how I could add this to the Cutlist script so that it produced the cutting list for all the items chosen in a selected layer without having to go through separate procedures to get there.
I was going to ask the author of CutListAndMaterials.rb if he was prepared to do it, but cannot find any way of contacting him.
Thanks in advance for any offers of assistance.
Advertisement