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]allshould 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

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement