sketchucation logo sketchucation
    • Login
    1. Home
    2. underarmcoder
    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
    U
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 4
    • Groups 1

    underarmcoder

    @underarmcoder

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

    underarmcoder Unfollow Follow
    registered-users

    Latest posts made by underarmcoder

    • RE: Please help with this code to normalize size to (1,1,1)

      Hi there, it's ok now i managed to run the TIG code ok. πŸ˜„ There is only one piculiar thing happening, if i resize to TIG.scaleto(1) the resulting width is (0.24 meters), and when i resize to 200, the ruler measures (5.080m) bounds width.

      Thanks alot! no no the move to origin is just a whimsy, the move to origin code is great i was just abit confused with the error message.

      i tried to select it, i obviously didnt manage!

      Thankyou so much for your help.

      I added this line r = r*39.37007874015748; to make (1) scale to 1m. obviously i have to adjust some setting. thanks.

      posted in Plugins
      U
      underarmcoder
    • RE: Please help with this code to normalize size to (1,1,1)

      Thanks!

      I was lost at this moment: then TIG.scaleto(dimension) in Ruby Console

      i need a ruby console plugin?

      i was hoping to add it for example into the end of this code, anything that runs is great.

      
      # Author ;        Todd Burch   http://www.smustard.com 
      
      require 'sketchup.rb' 
      
      class Move2OriginAndCenter
      
      def initialize 
      
        bb = Geom;;BoundingBox.new
      
        am = Sketchup.active_model        # Sketchup Active Model. 
        am.start_operation "Move To Origin" ; 
        se = am.active_entities           # Sketchup Active Entities.  Allows working inside a component.
        ss = am.selection                 # Work with selection, if any... 
        if (ss.length == 0) then ss = se ; end ;     # ...else work with whole model. 
      
        ss.each {|e|                       # add all geometry to our temporary bounding box
          bb.add(e.bounds) ; 
          } 
       
      
        trans = Geom;;Transformation.new(bb.center.vector_to(ORIGIN)) ;  # move the temp bounding box 
      
        status = Sketchup.active_model.entities.transform_entities(trans, ss.to_a ) ; 
        #puts "status is #{status}" ; 
      
        am.commit_operation ; 
        end ;  # initialize 
      
      end ; # class 
      
      UI.menu("Plugins").add_item("Move to Origin And Center") { Move2OriginAndCenter.new } if not file_loaded?(__FILE__) 
      file_loaded(__FILE__) 
      
      
      posted in Plugins
      U
      underarmcoder
    • RE: Please help with this code to normalize size to (1,1,1)

      i had this message in ruby console:

      
      TIG.scaleto(1)
      Error; #<NoMethodError; undefined method `bounds' for nil;NilClass>
      C;/Program Files/Google/Google SketchUp 8/Plugins/resize_mesh_111.rb;6
      (eval);6
      
      TIG.scaleto(1m)
      Error; #<SyntaxError; (eval);6; compile error
      (eval);6; syntax error, unexpected tIDENTIFIER, expecting ')'
      TIG.scaleto(1m)
                    ^>
      (eval);6
      TIG.scaleto(1.m)
      Error; #<NoMethodError; undefined method `bounds' for nil;NilClass>
      C;/Program Files/Google/Google SketchUp 8/Plugins/resize_mesh_111.rb;6
      (eval);6
      
      posted in Plugins
      U
      underarmcoder
    • Please help with this code to normalize size to (1,1,1)

      I want to write a plugin that takes a selected group and resizes it so that it fits in a (1,1,1) box , while keeping the model proportions.

      Someone advised me with this code, except that it is unfinished and i dont understand how to write a ruby plugin from juste these lines, please could you help me?

      e # your entity
      target_size = 1.m
      s = [e.bounds.width, e.bounds.height, e.bounds.depth].max
      r = target_size / s
      t = Geom;;Transformation.scaling(r)
      e.transform!(t)
      

      thankyou

      posted in Plugins
      U
      underarmcoder