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!
    Urasik Extensions | Lots of new extensions to check out Learn More

    Ruby help !

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 1 Posters 660 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

        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 Login
        • 1 / 1
        • First post
          Last post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement