• Login
sketchucation logo sketchucation
  • Login
🔌 Quick Selection | Try Didier Bur's reworked classic extension that supercharges selections in SketchUp Download

[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.
  • J Offline
    jolran
    last edited by jolran 4 Jan 2012, 18:56

    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 5 Jan 2012, 19:13

      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
      • J Offline
        jolran
        last edited by 5 Jan 2012, 20:16

        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
        • D Offline
          Dan Rathbun
          last edited by 5 Jan 2012, 21:09

          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 5 Jan 2012, 21:44

            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 5 Jan 2012, 22:30

              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
              • T Offline
                TIG Moderator
                last edited by 5 Jan 2012, 22:36

                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
                • D Offline
                  Dan Rathbun
                  last edited by 5 Jan 2012, 23:00

                  @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
                  • J Offline
                    jolran
                    last edited by 6 Jan 2012, 08:52

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

                    Advertisement