Method to Explode Groups by name beginning...
-
I need help with a method to explode select groups in my model, they are named "wall*".
So they would appear in model as "wall_1_3, wall_1_4, etc. They must all be exploded, but nothing else in the model. They are not sub-grouped, so no re-curse needed. I was playing with something like...model=Sketchup.active_model
entities=model.active_entities
Sketchup.active_model.active_entities.each{|e|e.explode if e.name =~ /\A(wall-)/}This does not work. I am unsure of method and syntax, and being humbled my now apparent limited skills. Any help would be appreciated.
-
Try
Sketchup.active_model.active_entities.grep(Sketchup;;Group).each{|e| e.explode if e.name=~/^[Ww]all/ }
Any group in the current active entities that has a name starting with
[Ww]all
should be exploded...
Obviously enclosing it in a module/method and start/commit_operation is needed...
But this the core code... -
Looks like you focused only on group class, and corrected the wall name syntax, and I am very grateful as it now works! Thanks Tig
Advertisement