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!
    πŸ«› Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Groups

    Scheduled Pinned Locked Moved Developers' Forum
    15 Posts 3 Posters 302 Views 3 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.
    • sdmitchS Offline
      sdmitch
      last edited by

      No, no error messages of any kind in the Ruby console. Yes, p4 and p5 are valid points. The adding of the groups was the last thing I was attemping to do after numerous successful runs of the plugin.

      Nothing is worthless, it can always be used as a bad example.

      http://sdmitch.blogspot.com/

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

        The face adds OK to one group, add the same face to the other using the same points.
        Then you must [?] have both groups albeit that they are on top of each other afterwards...

        Are you sure there are no typos in the actual code ??
        πŸ˜•

        TIG

        1 Reply Last reply Reply Quote 0
        • sdmitchS Offline
          sdmitch
          last edited by

          I copied the code directly from the plugin to my previous response. I add a puts statement and it did show the rail.entites variable rent was empty so I change the statements to add those entities into the step.entities variable sent and everything was there.

          Nothing is worthless, it can always be used as a bad example.

          http://sdmitch.blogspot.com/

          1 Reply Last reply Reply Quote 0
          • sdmitchS Offline
            sdmitch
            last edited by

            If I use rail.entities.add_line instead of rent.add_line, I get the error message

            Error: #<TypeError: reference to deleted Group>

            Nothing is worthless, it can always be used as a bad example.

            http://sdmitch.blogspot.com/

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

              Make the groups in turn [i.e. not at the same time] and add new geometry to their entities immediately after you make them.

              See if that helps.

              I assume you aren't erasing a group in your broader code ??

              TIG

              1 Reply Last reply Reply Quote 0
              • sdmitchS Offline
                sdmitch
                last edited by

                I tried making and re-makeing the groups but didn't have any success with that either. The entities are being created in a loop which complicates things. I finally gave up on the two group idea. It seems apparent that SU doesn't like dealing with more than one group at a time.

                Nothing is worthless, it can always be used as a bad example.

                http://sdmitch.blogspot.com/

                1 Reply Last reply Reply Quote 0
                • Dan RathbunD Offline
                  Dan Rathbun
                  last edited by

                  Create and hold refs to the groups and their entities collection OUTSIDE the loop.

                  I'm not here much anymore.

                  1 Reply Last reply Reply Quote 0
                  • sdmitchS Offline
                    sdmitch
                    last edited by

                    Dan, The groups were created outside the loop originally and the entities added inside the loop. All seemed well since there were no errors shown in the ruby console but, dispite adding entities to the second group, they weren't added to to model only the entities added to the first group. I have tested this independently and it works without a problem so was just something weird going on that particular plugin I guess.

                    Nothing is worthless, it can always be used as a bad example.

                    http://sdmitch.blogspot.com/

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

                      You can readily make multiple groups and add stuff to any of their entities.
                      Even new groups inside new groups!
                      But if you make a new group in a sub-process and then ignore [i.e. leave it empty] it it will vanish when you leave the sub-process...
                      So just make these groups 'as you need them' and add stuff to their entities early on so that they then subsist...

                      πŸ˜’

                      TIG

                      1 Reply Last reply Reply Quote 0
                      • sdmitchS Offline
                        sdmitch
                        last edited by

                        I renamed the groups steps and rails instead of step and rail thinking that Ruby was confused by step since that is a loop method but it wasn't until I added something to the second group,rails, first that all was right with the world at least as far as this plugin is concerned. I had copied the original loop code into the Ruby Web Console and it ran without modification. It would be interesting to know why.

                        Nothing is worthless, it can always be used as a bad example.

                        http://sdmitch.blogspot.com/

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

                          Please don't reuse references or confuse them with methods etc - coding is complicated enough as it is πŸ˜‰
                          I suggest you prefix new groups with a single meaningful letter, and suffix their entities with 'ents'
                          So 'sgroup' > 'sents' and 'rgroup' > 'rents' etc.
                          Then any other reference to 'step' or 'rail' will pass without incident...
                          And you can easily spot the relationship of s=step and r=rail πŸ’­
                          For example, I always call my temporary group 'tgroup' and its entities 'tents'.

                          TIG

                          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