Highlighting items in groups or components
-
We would like to find a way for users to identify which geometry they have marked to be lights (or other special features). We can easily select (and highlight) lights at the top level, but many times people want to mark a light bulb or surface in a group or component as a light, and then it is harder to find a way to identify them later (Sometimes people want to see what lights they have already defined)
Does anyone know any existing scripts which try to find and/or identify things inside of groups or components?
Or, does anyone have any ideas?
-
Let's assume the component definition is known and we called it defn
model=Sketchup.active_model ss=model.selection ss.clear defn.instances.each{|e|ss.add(e)} ### this highlights all instances of the component even inside groups or component definitions...
Let's assume you want to find the defn from a picked instance...
You can also code it as a 'tool' to let you pick an instance...defn=ss[0].definition defn.instances.each{|e|ss.add(e)}
If you have things with common attributes like 'light' then you could search model.entities/definition.entities for those and highlight them ?
??? -
Interesting TIG...
I didn't know you could add something to the selection set which was inside of a group or component. Let me give it a try. (I have noticed that people who try things which are not (necessarily) documented, often learn new things... )
If it works, I should also be able to add faces which are inside a group to component to the selection set. (People can make a component, group or face glow as a light)
-
My Selection Toys plugin allows the user to select all instances of a component/group in a model regardless of nesting.
There is a quirk selecting groups/components that's not within the active space though - you'll see a ghost bounding boxes. -
Word of warning doing some things to selected entities that have other parentage can cause bugsplats - e.g just try to move them! Remember to
model.selection.clear
them afterwards - I have successfully deleted things or changed their layers or materials within definitions so it is possible... -
I've used my SelectionMemory script to do the opposite - select edges outside the space I was in. Specifically, I would group a profile shape, select and "memorize" the edges to be used for FollowMe, then go inside the profile's group and "recall" the edges, then start the FollowMe tool and click on the profile face. It prevents the extruded shape from reacting to the edges of the path - very handy in some cases.
Advertisement