Need some help again.
-
A few months ago, Tig helped me with some syntax for exploding walls in my model grouped by name, The specific line of code was:
Sketchup.active_model.active_entities.grep(Sketchup;;Group).each{|e| e.explode if e.name=~/^[Ww]all/ }I now have to explode components by the same naming system, starting with 'wall'.
I was thinking I could add another line to the module and simply switch(Sketchup::Group)with(Sketchup::ComponentInstance)and everything should work fine... but it does not. I found myself frustrated again and decided to come back to the pros and ask for some help here. -
Unless the Instance itself is named 'wall' it needs to refer to the Definition thus:
Sketchup.active_model.active_entities.grep(Sketchup;;ComponentInstance).each{|e| e.explode if e.definition.name=~/^[Ww]all/ }However, to delete Instances which are themselves named 'wall' use
Sketchup.active_model.active_entities.grep(Sketchup;;ComponentInstance).each{|e| e.explode if e.name=~/^[Ww]all/ } -
Thanks again TIG! I am very grateful. I knew I was missing something, but was pretty much stumped. Thanks for putting me back on track, and so quickly. Cheers
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