sketchucation logo sketchucation
    • Login
    1. Home
    2. biervat
    3. Posts
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    B
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 8
    • Posts 16
    • Groups 1

    Posts

    Recent Best Controversial
    • Inference lock along a random vector

      I'm trying to inference lock along a random vector. I wrote this and it works as long as @vector is along the red/green or blue axis but it doesn't lock in any other situation. Does anyone has a solution?

      
      @picked_first_ip.copy(@mouse_ip)
      @mouse_ip = Sketchup;;InputPoint.new(@picked_first_ip.position.offset(@vector))
      view.lock_inference(@picked_first_ip,@mouse_ip)
      
      
      posted in Developers' Forum
      B
      biervat
    • RE: Rbclipper in sketchup 2017

      I got it working. I used the ruby-c-extension-example to create a visual studio 2017 project and compiled it. You can find the VS2017 project in the link and compile it or use the so in releases if you have Sketchup 2017 x64.

      Error 404 (Not Found)!!1

      favicon

      (drive.google.com)

      posted in Developers' Forum
      B
      biervat
    • Rbclipper in sketchup 2017

      I'm trying to use the rbclipper library in sketchup 2017 pro x64 using this tutorial:
      http://dagrende.blogspot.be/2011/08/install-rbclipper-in-sketchup-8.html

      But instead of ruby 1.8.7 I used 2.2.4 and instead of DevKit-tdm-32-4.5.2-20110712-1620-sfx.exe I used DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe

      When I try running it in Sketchup I get this error

      
      require 'clipper'
      Error; #<LoadError; 126; The specified module could not be found.   - C;/Users/maarten/AppData/Roaming/SketchUp/SketchUp 2017/SketchUp/Plugins/clipper.so>
      C;/Program Files/SketchUp/SketchUp 2017/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb;54;in `require'
      C;/Program Files/SketchUp/SketchUp 2017/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb;54;in `require'
      <main>;in `<main>'
      SketchUp;1;in `eval'
      
      

      What am I doing wrong?

      posted in Developers' Forum
      B
      biervat
    • Convert to length error

      My code gives a Cannot convert "100.00mm" to length error on some computers but not on other computers. How is this possible?

      I thought the problem was that some computers use a , instead of a . to indicate a decimal mark but changing the language input on those computers doesn't solve the problem.

      posted in Developers' Forum
      B
      biervat
    • RE: Get mac address in ruby

      Thanks that works

      posted in Developers' Forum
      B
      biervat
    • RE: Get mac address in ruby

      It doesn't work in windows 10
      I get this error:

      
      Error; #<NoMethodError; undefined method `pfamily' for nil;NilClass>
      C;/Users/maarten/AppData/Roaming/SketchUp/SketchUp 2017/SketchUp/Gems64/gems/macaddr-1.7.1/lib/macaddr.rb;86;in `block in from_getifaddrs'
      C;/Users/maarten/AppData/Roaming/SketchUp/SketchUp 2017/SketchUp/Gems64/gems/macaddr-1.7.1/lib/macaddr.rb;85;in `select'
      C;/Users/maarten/AppData/Roaming/SketchUp/SketchUp 2017/SketchUp/Gems64/gems/macaddr-1.7.1/lib/macaddr.rb;85;in `from_getifaddrs'
      C;/Users/maarten/AppData/Roaming/SketchUp/SketchUp 2017/SketchUp/Gems64/gems/macaddr-1.7.1/lib/macaddr.rb;62;in `address'
      <main>;in `<main>'
      SketchUp;1;in `eval'
      
      
      posted in Developers' Forum
      B
      biervat
    • RE: Get mac address in ruby

      Does it work inside sketchup?

      posted in Developers' Forum
      B
      biervat
    • Get mac address in ruby

      Is it possible to get the mac address in ruby?
      I've tried this gem: https://rubygems.org/gems/macaddr but I can't get it working.

      I've also tried executing shell commands from within ruby with backticks getmac and %x(getmac) but I don't get a response.

      posted in Developers' Forum
      B
      biervat
    • RE: Pushpull face on a cube

      Thanks that did the trick. Is there a reason why the face isn't removed by the pushpull command?

      
      # create cube
      subelement.entities.add_face(pointscube).pushpull(height)
      # create face on side of cube
      face = subelement.entities.add_face(retourpoints)
      fbounds = face.bounds
      face.pushpull(isolatie + binnenschil)
      subelement.entities.each do |ent|
        if ent.is_a?(Sketchup;;Face)
      	ebounds = ent.bounds
      	if ebounds.max == fbounds.max and ebounds.min == fbounds.min
      	  ent.erase!
      	  break
      	end
        end
      end
      
      
      posted in Developers' Forum
      B
      biervat
    • RE: Pushpull face on a cube

      Sorry for my explanation but english isn't my first language.
      I first create a plane inside a group and pushpull it. This is the slab in the picture.
      Then I create a face inside the same group. But when I pushpull this one it creates a new cube touching the slab. When I manually delete the mutual face it becomes a solid group.

      Both objects in the picture are created with the same script.


      Capture.PNG

      posted in Developers' Forum
      B
      biervat
    • Pushpull face on a cube

      In my script I want to pushpull a newly created face on a side of a cube. When an edge of the face coincide with the edge of the cube the resulting group isn't a solid group. I don't have this problem when the edges don't coincide. What am I doing wrong?

      
      # create cube
      subelement.entities.add_face(pointscube).pushpull(height)
      # create face on side of cube
      face = subelement.entities.add_face(points)
      face.pushpull(isolatie + binnenschil)
      
      

      Capture.PNG

      posted in Developers' Forum
      B
      biervat
    • RE: Making a hole in a group with multiple subgroups

      I've found the problem. It was in line "opening = subelement.entities.add_group"
      I created a group inside the group I wanted to subtract.

      posted in Developers' Forum
      B
      biervat
    • RE: Making a hole in a group with multiple subgroups

      Yes @wandgroep is a group containing several groups which contain several manifold groups.

      the error occurs in the line "opening = subelement.entities.add_group" after the first subtraction is done. When I delete the subtract line, I don't get the error and every cube is drawn correctly in the correct group.
      It looks like all subelement are deleted after I subtract the first subelement.

      posted in Developers' Forum
      B
      biervat
    • Making a hole in a group with multiple subgroups

      I'm writing a script to make a hole in a group with multiple subgroups.
      I iterate through the group and subtract a box if they intersect.
      The boxes are created correctly but it gives the following error:
      #<Deleted Entity:0x65d174a8>
      Error: #<TypeError: reference to deleted Group>

      def addhole(beginx,beginz,breedte,hoogte)
          #beginpunt x = afstand tot begincoordinaat muur; y = hoogte tov nulpas
          dikte = @wandgroep.local_bounds.depth
          openingbound = Geom;;BoundingBox.new
          openingbound.add([beginx,0,beginz],[beginx + breedte,dikte,beginz + hoogte])
          points = [
              [beginx,0,beginz],
              [beginx,0,beginz + hoogte],
              [beginx + breedte,0,beginz + hoogte],
              [beginx + breedte,0,beginz]
          ]
          @wandgroep.entities.to_a.each do |element|
            if not openingbound.intersect(element.bounds).valid?
              if element.typename == 'Group'
                if element.manifold?
                  opening = @wandgroep.entities.add_group
                  opening.entities.add_face(points).pushpull(dikte)
                  result = opening.subtract(element)
                else
                  element.entities.to_a.each do |subelement|
                    opening = subelement.entities.add_group
                    opening.entities.add_face(points).pushpull(dikte)
                    result = opening.subtract(subelement)
                  end
                end
              end
            end
          end
        end
      
      posted in Developers' Forum
      B
      biervat
    • Delete a group in ruby

      How can I remove a group that I have created earlier in a ruby script.

      ` wandgroep = Sketchup.active_model.active_entities.add_group
      ....

      I want to remove the group here.`

      posted in Developers' Forum
      B
      biervat
    • Save and recall parameters of an object created with ruby

      I'm writing an extension to create a wall in a simular way as the profile builder plugin. Before you draw the wall you have to adjust several parameters (height, width, ...). But when the wall is drawn I want the possibility to modify these parameters. How can I save those parameters to the wall object en how can I recall them when I want to modify the object?

      posted in Developers' Forum
      B
      biervat
    • 1 / 1