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

    [Code] Scarpino's SphereTool Sample ver 2.1.0

    Scheduled Pinned Locked Moved Developers' Forum
    15 Posts 2 Posters 3.7k 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.
    • D Offline
      driven
      last edited by

      I'll try and find all my notes re. skell, interestingly, from what you just outlined, it may suffer from 'entities confusion', sometimes it ran and other times it just melted SU...

      With Mat's help, I attempted to have this one work along the user drawn axis, so you could e.g. create a string of pearls.

      Could you add or suggest how that could be done?

      Then it's quite different from all the others.

      john

      like so...

      learn from the mistakes of others, you may not live long enough to make them all yourself...

      1 Reply Last reply Reply Quote 0
      • D Offline
        driven
        last edited by

        Ok, all works on my mac,
        I had to add the full path to the
        require("/Library/Application Support/Google SketchUp 8/SketchUp/plugins/Scarpino/SphereMaker/spheretool.rb")
        and I used a couple of icons I had from the last play, and I just used same full folder path for them as well.one I made earlieractually two
        I'll make some nicer ones if you want, this was my first attempt at making icons in SU... john

        learn from the mistakes of others, you may not live long enough to make them all yourself...

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

          @driven said:

          With Mat's help, I attempted to have this one work along the user drawn axis, so you could e.g. create a string of pearls.

          Could you add or suggest how that could be done?

          See a new post (... I must have been reading your mind.)
          I made a Library edition:
          [ Code ] Scarpino's SphereUtil Sample

          I'm not here much anymore.

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

            @driven said:

            I had to add the full path ... john

            Oh to get SU to find the icons ??

            I can prepend the icon paths with: File.basename(__FILE__)

            ... the UI::Command class is cranky sometimes, with the icon locations.

            The icons look fine.. it's an example anyway.

            I could tie it all up in an rbz for easy download. (Need to do the extension registration script first.)

            I'm not here much anymore.

            1 Reply Last reply Reply Quote 0
            • D Offline
              driven
              last edited by

              @dan rathbun said:

              VERSION 2.1.0
              added some model tracking in to account for switching back and forth between models on Mac.

              I don't follow what's meant to happen, can't see anything new in my context menu.
              When you switch between models, you switch tool and undo stacks automatically.

              am I being dim? john

              @unknownuser said:

              Oh to get SU to find the icons ??
              no, before trying with icons, the path was failing.
              I always use full or defined paths with require, it seems flakey. i.e. require path + "find"
              OT: have you use find.rb with SU, it really shows up problems with 'Path' on mac's.

              learn from the mistakes of others, you may not live long enough to make them all yourself...

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

                @driven said:

                I don't follow what's meant to happen, can't see anything new in my context menu.

                Just a note, that when I referred to context menu, I was referring to entering and exiting group/component edit modes, via the context popup items "Edit Group" and "Close group".

                You have to point to the group and right-click the mouse (or you don't see these items on the popup.)

                Previously, the example tool, ignored any change in context, in fact, it was hard-coded to ALWAYS use the model's entities. So as Matt wrote it, you could not draw a sphere inside a group or component.

                So in 2.0.0, I changed it to use active_entities, but once the construction point (for the center,) was drawn, the tool would put the sphere in the edit context of the c_point, even if the user had changed the edit context.

                Version 2.1.0, checks to see if the edit context has changed when the second click is made, and acts within the new context, instead.

                I'm not here much anymore.

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

                  Well it on PC we can use a singleton instance of a tool, there's only one stack, and model.

                  But on Mac, this example now makes a new tool for each model's toolstack, but only ONCE.

                  His example was actually creating a new instance EACH time the toolbar button was clicked. That makes ruby garbage collection do more work.
                  And he was having ALL instances (models,) share 2 global variables. $ents and $c_point

                  I'm not here much anymore.

                  1 Reply Last reply Reply Quote 0
                  • D Offline
                    driven
                    last edited by

                    @dan,
                    I missed the fact you started the 2nd thread for this. I had 'another look at line tool, but what I meant is more like the Cyl.class at the bottom.

                    i.e. After the user draws a line, a base circle 'path' is created, then at the line's 'mid-position' a 'filled circle' at 90ยบ to path, with rad 1/2 line length is created, then the follow-me, clean-up, etc...
                    You end up with the new axis aligned to the original drawn line and could select the end point to continue a 'string of pearls'... If you the intersect those, the geometry could be line-up, without having to rotate groups manually. However, clytool dosen't work here...

                    I've been distracted by almost having a WebDialog do the same things as my macMessage video shows. [but it's an 'almost' standard webdialog].

                    john

                    learn from the mistakes of others, you may not live long enough to make them all yourself...

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

                      @driven said:

                      @dan, I missed the fact you started the 2nd thread for this. I had 'another look at line tool, but what I meant is more like the Cyl.class at the bottom.

                      Oh OK. Well.. you wish to do it the easy way, huh ? ๐Ÿ˜›

                      That's subclassing a current class... a topic for a new thread.

                      I'm not here much anymore.

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

                        @driven said:

                        I'll make some nicer ones if you want, this was my first attempt at making icons in SU... john

                        A note about toolbar icons.

                        GIFs are not the best. (They are good for print ads, cartoons, etc.) But the edges look ragged.

                        You should save as PNG, as the edges are anti-aliased. (smoothed via blending.)

                        I'm not here much anymore.

                        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