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

    Topics

    • romuloigorR

      How to get transformation.origin of a internal component

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      2
      0 Votes
      2 Posts
      407 Views
      TIGT
      First find the insertion point of the Redbox instance in its current context. Next find the transformation of the Bigbox container instance. You need to get a handle on the 'Redbox'. Let's assume there is only one instance and that's inside Bigbox. redbox = model.definitions['Redbox'].instances[0] Now get its insertion point pt = redbox.transformation.origin Now let's assume there's only one instance of 'Bigbox'. bigbox = model.definitions['Bigbox'].instances[0] Get its transformation tr = bigbox.transformation Apply that to the point 'pt' pt.transform!(tr) The point 'pt' is now relative to the model's origin, NOT the Bigbox's internal origin...
    • romuloigorR

      How to count duplicates hash itens in Ruby

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      6
      0 Votes
      6 Posts
      2k Views
      Dan RathbunD
      # EXAMPLE - untested module Romuloigor module Product @@product = { ;count => {}, ;list => [ { "product" => 1, "x" => 200, "y" => 100, "z" => 18}, { "product" => 1, "x" => 200, "y" => 100, "z" => 18}, { "product" => 1, "x" => 300, "y" => 100, "z" => 18}, { "product" => 2, "x" => 300, "y" => 100, "z" => 18}, { "product" => 2, "x" => 100, "y" => 100, "z" => 18}, { "product" => 2, "x" => 100, "y" => 100, "z" => 18}, { "product" => 3, "x" => 100, "y" => 100, "z" => 18} ] } class << self def add(product) # @@product[;list] << product # end # add() def recount() # @@product[;count]= @@product[;list].inject(Hash.new(0)) {|h, e| h[e] += 1; h} # end # recount() def count(product) # total = @@product[;count][product] return ( total ? total ; 0 ) # end # count() def list() # list = "" @@product_list[;count].each {|k,v| list << "#{k.inspect} count = #{v}\n" } return list # end # list() end # proxy class end # module Product end # module Romuloigor
    • romuloigorR

      Tool Scale does not update dictionary. WHY? is Bug?

      Watching Ignoring Scheduled Pinned Locked Moved SketchUp Bug Reporting sketchup
      1
      0 Votes
      1 Posts
      1k Views
      No one has replied
    • 1 / 1