sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Need some help again.

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 318 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S Offline
      Skastafari
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        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/ }
        

        TIG

        1 Reply Last reply Reply Quote 0
        • S Offline
          Skastafari
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement