Sketchucation Tools 5.0.7 | Licensing improvements and bug fixes Learn More

Alkategóriák

  • No decscription available

    20 Témakörök
    462 Hozzászólások
    HornOxxH
    @pilou said: More appetizing in chocolate! Eggs are good as well - but only very fragile when falling down in SketchyPhysics
  • I must be dumb

    3
    0 Szavazatok
    3 Hozzászólások
    238 Megtekintések
    thomthomT
    @thierry_st_malo said: It works for the red and the green axis, but not for the blue one. Ridiculously, I can't see why. What you explain more what "doesn't work"? Exactly what happens, and what did you expect? Any errors?
  • Model Operation blockform methods.

    24
    0 Szavazatok
    24 Hozzászólások
    3k Megtekintések
    Dan RathbunD
    Putting this on the back burner until I get some feedback.
  • How to count duplicates hash itens in Ruby

    6
    0 Szavazatok
    6 Hozzászólások
    3k Megtekintések
    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
  • New tool's "initialize" starts bf prev tool's "deactivate"

    3
    0 Szavazatok
    3 Hozzászólások
    304 Megtekintések
    S
    @thomthom said: Do you stuff in the Tool's activate callback. That should trigger after deactivate. Initialize triggers when you create the tool instance - not when it's activated. You can reuse a tool instance - where activate is the one that will trigger when your tool activates. (How do you activate the tools btw? model.select_tool or model.tools.push_tool ?) Hi Thomthom. Man, such a stupid error of me. I did use the initialize method instead of the activate method. Btw, I use select_tool ToolName.new Thanks for the answer, funny I didn't saw the error myself
  • Making changes visible

    7
    0 Szavazatok
    7 Hozzászólások
    379 Megtekintések
    Dan RathbunD
    You have to save the view's camera properties to a new Sketchup::Camera instance, then restore it. view = Sketchup.active_model.active_view vcam = view.camera props = [vcam.eye,vcam.target,vcam.up,vcam.perspective?] cam = Sketchup;;Camera.new(*props) view.zoom_extents view.camera= cam
  • Creating rbz files on Win7

    11
    0 Szavazatok
    11 Hozzászólások
    2k Megtekintések
    K
    Mistry with win7 zip files solved!!! Some how my folder option to hide known extensions was selected and this created the problem making a ziped file a ziped folder. I know I had nothing to do with that change as it took me a long time to find Folder Options after I started looking for them. Keith
  • Determine if face is covered by shadow

    2
    0 Szavazatok
    2 Hozzászólások
    136 Megtekintések
    TIGT
    I wrote this last year http://forums.sketchucation.com/viewtopic.php?p=371243#p371243 'ShadowProjector' If calculates shadows cast on faces and % area etc [image: lCSs_ShadowProjector_Example.PNG]
  • [Info] Free Ruby Book: &quot;I Love Ruby&quot;

    4
    0 Szavazatok
    4 Hozzászólások
    465 Megtekintések
    daleD
    If that's Ruby, then I love Ruby too! Thanks Dan. I perused the book, and as someone who hasn't a clue it looked to me like it is well written, and should be easy for the beginner to get a grasp.
  • [Code] (Iterating) Finding Definitions

    4
    0 Szavazatok
    4 Hozzászólások
    742 Megtekintések
    Dan RathbunD
    Yes it should, and now is. Updated the code. (I was uniq!'ing in the calling methods, and at the last moment replaced several in those methods, by adding the .uniq! to the return statement. I did think about which uniq to use, for a split-second, and didn't want to create a new array object, so I added ! to the end. That's what happens when ya' rush.) Thanx for the check TIG!
  • Developing a plugin/macro for orbiting based on input

    6
    0 Szavazatok
    6 Hozzászólások
    295 Megtekintések
    Dan RathbunD
    Did you read the "linetool.rb" file in the "Examples" directory ??
  • Question about order in selection

    20
    0 Szavazatok
    20 Hozzászólások
    3k Megtekintések
    Dan RathbunD
    Here's a start. Rename the module or cut & paste the proxy class block into one of your modules. module Sort class << self def sort_faces_by_vertex() @sel = Sketchup.active_model.selection.to_a @sel.delete_if {|e| not e.is_a?(Sketchup;;Face) } @sel.sort! {|a,b| ([a.vertices.min{|v1,v2| v1.position.x <=> v2.position.x }.position.x, a.vertices.min{|v1,v2| v1.position.y <=> v2.position.y }.position.y] <=> [b.vertices.min{|v1,v2| v1.position.x <=> v2.position.x }.position.x, b.vertices.min{|v1,v2| v1.position.y <=> v2.position.y }.position.y] ) } end def assign_room_nums_to_faces() sbv = sort_faces_by_vertex() sbv.each_with_index {|face,i| dict = face.attribute_dictionary('Properties',true) dict['name']= "Room #{(i+1).to_s}" } end end # proxy class end # module Sort
  • Creating components from existing objects

    12
    0 Szavazatok
    12 Hozzászólások
    728 Megtekintések
    A
    @sdmitch said: There is always a way but at what cost. The code would no doubt expand from 3 lines to 3000. I'm on a framerate sensitive medium, so anything I can do to improve frame rate would be useful. It would be great if you have any tips on how to set the LOD for the miniature.
  • Toggle Dimmensions?

    11
    0 Szavazatok
    11 Hozzászólások
    441 Megtekintések
    Dan RathbunD
    @thomthom said: @dan rathbun said: So mitcorb, no you can NOT edit them by accident when they are hidden (singly or globally.) All though they still update. Yes.. if associative and their anchor points are moved or changed. I'm not sure about styling fonts, etc. I suppose you can still access them via an entities collection... and I wonder if you could FORCE them into the selection set without crashing the application.
  • What's the difference.

    5
    0 Szavazatok
    5 Hozzászólások
    252 Megtekintések
    KrisidiousK
    so I take it I'm covered with Your cleanup tools... kool.
  • Get last image export settings?

    4
    0 Szavazatok
    4 Hozzászólások
    208 Megtekintések
    Dan RathbunD
    FYI... I have a bug issue logged that Sketchup::read_default() cannot return DWORD values. Basically the method assumes anything you want to read was written with Sketchup::write_default(), which inspects objects into evaluatable strings before storing them. So.. Sketchup::read_default() is stupid and always tries to run the stored values back through Ruby's eval() without Type checking. When a error occurs it seems the method's rescue block just returns nil. So you'll need to use the WIN32OLE class ("win32ole.so" file,) and the Windows Scripting Host interface to read registry values. See: [Plugin Library] Win32API and Win32OLE so files
  • Toggle Construction geometry?

    7
    0 Szavazatok
    7 Hozzászólások
    512 Megtekintések
    Dan RathbunD
    I note there are 7 other settings that are positive, and begin with the prefix "Display".. and one positive that begins with the prefix "Show"... The lack of convention is annoying.
  • Sketchup::load under different binding?

    7
    0 Szavazatok
    7 Hozzászólások
    325 Megtekintések
    Dan RathbunD
    @thomthom said: That seem to work perfectly! Excellent! 4 trys is the charm. Man, I love Ruby's flexibility!
  • Naming an entity

    4
    0 Szavazatok
    4 Hozzászólások
    1k Megtekintések
    S
    Thank you very much TIG for the prompt and in depth reply. There is a lot of info to digest and I will try it out. Thank you again.
  • Sharing variables between functions

    3
    0 Szavazatok
    3 Hozzászólások
    268 Megtekintések
    K
    amazing how easy things are sometimes. guess i have a long way to go thanks! D
  • JetBrain/RubyMine Support for SketchUp Ruby Class, Method an

    10
    0 Szavazatok
    10 Hozzászólások
    3k Megtekintések
    Dan RathbunD
    Probably will.. when I get back a Win7 notebook that needs to go back to Dell for a HD replacement & OS reimage.

Advertisement