sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    [SOLVED] Booleans operations available to free SU?

    Scheduled Pinned Locked Moved Developers' Forum
    9 Posts 4 Posters 583 Views 4 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.
    • jolranJ Offline
      jolran
      last edited by jolran

      Hi!

      Is for ex: group1.subtract(group2),available to free version users of Sketchup?

      It says version 8+ in the API, but I got unsecure it will work for everyone when I was adding it to my code.

      Intersect_with is faster, but it's not trivial to heal the intersections afterwards..

      Thanks.

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

        hi jolan,

        if you write a test, I'm sure someone will run it... no need to be a 'coder' themselves... 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
        • jolranJ Offline
          jolran
          last edited by

          Hi John. Thanks for replying.

          Thought I would get a quick yes or no on this one.

          I'm using the solid subtract method for some tests in "Hatchfaces" development.
          So it's kinda burried in the code.. Kinda difficult to post a test snippet for that purpose from my code just yet.
          Maybe later when or if it's a more definitive solution.

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

            I checked the Release Notes webpages for both the app and the API, and it's not clear.

            I'm not here much anymore.

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

              I was thinking a copy/paste 'visual' test like this may be useful
              subtract

              # Test booleans on Free
               #Create the box
              
              ent = Sketchup.active_model.entities 
              face = ent.add_face [0,0,0], [1,0,0], [1,1,0], [0,1,0] 
              face.reverse! 
              face.material = Sketchup;;Color.new("Coral")
              face.pushpull 1
              Sketchup.active_model.materials.add "Purple" 
              group1 = ent.add_group face.all_connected
              
               #Create the 2nd box
              
              ent = Sketchup.active_model.entities 
              face = ent.add_face [0.5,0,0.5], [1.5,0,0.5], [1.5,1,0.5], [0.5,1,0.5] 
              face.reverse!
              face.material = Sketchup;;Color.new("GreenYellow")
              face.pushpull 1
              Sketchup.active_model.materials.add "Blue" 
              group2 = ent.add_group face.all_connected 
              
               #test .subtract
              entities = Sketchup.active_model.entities
               instance1 = entities[0]
               instance2 = entities[1]
               result = instance1.subtract(instance2)
               
               
              =begin
               #test .union
              entities = Sketchup.active_model.entities
               instance1 = entities[0]
               instance2 = entities[1]
               result = instance1.union(instance2)
              
              
                #test .trim
              entities = Sketchup.active_model.entities
               instance1 = entities[0]
               instance2 = entities[1]
               result = instance1.trim(instance2)
               
               #test .split
               entities = Sketchup.active_model.entities
               instance1 = entities[0]
               instance2 = entities[1]
               result = instance1.split(instance2)
               =end
              

              union, trim and split can be swapped to test them as well.
              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
              • D Offline
                driven
                last edited by

                in answer to your original question,

                I just installed free on this laptop and copy/pasted my code...
                Error: #<ArgumentError: (eval):25:insubtract': 'subtract' is a Pro only feature.>
                (eval):25
                (eval):25`
                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
                • TIGT Offline
                  TIG Moderator
                  last edited by

                  It's dead easy to post a test script and a snippet.
                  Make a SKP [v8] with two cubes that are separate groups that partially overlap.
                  Select the two groups.
                  Copy/Paste into the Ruby Console a short one-liner for v8-Free to test...
                  Something like:
                  s=Sketchup.active_model.selection;s[0].subtract(s[1])
                  Does one get subtracted from the other in v8-Free?
                  I suspect NOT.
                  BUT it does in v8-Pro.Capture.PNG

                  TIG

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

                    @driven said:

                    in answer to your original question,

                    I just installed free on this laptop and copy/pasted my code...
                    Error: #<ArgumentError: (eval):25:insubtract': 'subtract' is a Pro only feature.>
                    (eval):25
                    (eval):25`
                    john

                    Makes sense.. otherwise we'd be able to write Pro feature custom tools for Free. which defeats the purpose of a Pro version.

                    I'm not here much anymore.

                    1 Reply Last reply Reply Quote 0
                    • jolranJ Offline
                      jolran
                      last edited by

                      Was gonna post a snippet this morning but you guys did the work for me πŸ˜„

                      So I see John, you got an error "is a Pro only feature."
                      That pretty much sums it up. Like Tig also suspected.

                      Dan said.

                      @unknownuser said:

                      Makes sense.. otherwise we'd be able to write Pro feature custom tools for Free

                      Yeah, thats why I posted the question. Being a PRO user I momentarily took this method for granted when I did not receive an error message in my code.

                      Thanks everyone involved for clearing this up.

                      Maybe Google should put PRO label for methods like this after the 8+ in the API.

                      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