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

    Magnifico

    @Magnifico

    0
    Reputation
    1
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    Magnifico Unfollow Follow
    registered-users

    Latest posts made by Magnifico

    • RE: Retrieve the size of bounding box of selection

      Nice all this but, i am new in ruby, how can i retrieve the size of all component... including sub-component?

      ` mod = Sketchup.active_model # Open model
      ent = mod.active_entities # All entities in model

      message = ""
      ent.each { |e|
      n = e.name
      scale_x = ((Geom::Vector3d.new 1,0,0).transform! e.transformation).length
      scale_y = ((Geom::Vector3d.new 0,1,0).transform! e.transformation).length
      scale_z = ((Geom::Vector3d.new 0,0,1).transform! e.transformation).length
      bb = nil
      if e.is_a? Sketchup::Group
      bb = Geom::BoundingBox.new
      e.entities.each {|en| bb.add(en.bounds) }
      elsif e.is_a? Sketchup::ComponentInstance
      bb = e.definition.bounds
      end

      if bb
      dims = [ width = bb.depth * scale_x, height = bb.width * scale_y, depth = bb.height * scale_z ]
      message = message + "Cabinet: " + n + "\nHeight: #{dims[0].to_l}\tWidth: #{dims[1].to_l}\tDepth: #{dims[2].to_l}"
      end
      }
      UI.messagebox(message, MB_MULTILINE)`

      I would like to have dimensions of all pieces of the cabinet.
      I know Cutlist. But i only need name of piece and dimensions.
      And Cutlist script is to complicated for me.
      Someone can help me with this? PLZ

      posted in Developers' Forum
      M
      Magnifico