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

    Ruby help !

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 1 Posters 607 Views 1 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.
    • M Offline
      Matt666
      last edited by

      hi all !
      I try to answer to this post.

      the code, logically, is not hard. But I have a strange problem. It's a ruby bug, in my opinion ; and I would like to know how the ruby masters can solve this πŸ˜‰

      Here are some attempts to show the problem.

      Procedure of the script :
      1- Explodes all components and groups
      2- Groups all entities by layer.

      When I select some entities, "Bryce" included, I have this error :

      @unknownuser said:

      Error: #<ArgumentError: C:\Program Files\Google\Google SketchUp 6\Plugins\groupByLayer.rb:67:in `add_group': All Entities must have a common parent>
      C:\Program Files\Google\Google SketchUp 6\Plugins\groupByLayer.rb:67

      On line 77, I have this :

      model.active_entities.add_group(sel)
      

      When I select some entities, but without "Bryce", the program runs completely !! 😲

      So I added a line can show all entity that is not parent to the model, in my code :

      puts ee if ee.parent != model
      

      When I try with or without "Bryce", plenty of entities are written in the ruby window ! 😲 (2)

      Finally, I tried to erase the line which groups the selection.
      And finally, no entities written in the ruby window, and the script runs completely 😲 😲 (3)

      Straaaange !!!!

      So in my opinion, it's the add_group line which bugs my script !!!
      Can you help me please ??? I don't understand ??? πŸŽ‰

      Sniff...


      The entire code !

      Frenglish at its best !
      My scripts

      1 Reply Last reply Reply Quote 0
      • M Offline
        Matt666
        last edited by

        I think there is a problem with Bryce. At first I was thinking about a problem with faces oriented components, but it's not true. Just Bryce !! Kiiiiill Bryyyyce πŸ‘Ώ πŸ‘Ώ

        So I erased bryce form the selection, and the code works.

        Frenglish at its best !
        My scripts

        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