⚠️ Update | Sketchucation Tools 5.0.8 released with licensing improvements and bugfixes Download

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
  • Help! When an Object get touched by a Shadow (sun shade)

    4
    0 Szavazatok
    4 Hozzászólások
    710 Megtekintések
    JuantxoJ
    You need to know if a panel is in shadow or not using this 2 vectors and using cosine law panel verctor-> v=Sketchup.active_model.selection[0].normal sun vector-> s=Sketchup.active_model.shadow_info["SunDirection"] But you need to know also if there is some object projecting shadow over the panel using raytest with sun vector and some points of the panel. You can modify this step and look for other methods if you need more accuracy...
  • Preserve integrity of curves when creating faces

    2
    0 Szavazatok
    2 Hozzászólások
    322 Megtekintések
    D
    I think in the plugin code "weld" is what you need (google translator)
  • Maxwell export plugin for skecthup

    6
    0 Szavazatok
    6 Hozzászólások
    4k Megtekintések
    brodieB
    This is probably a better solution since there are different versions of Maxwell and SU. You should be able to download the plugin including the exporter here... http://www.maxwellrender.com/index.php/try/sketchup -Brodie
  • Read_default webdialog position on OSX

    5
    0 Szavazatok
    5 Hozzászólások
    600 Megtekintések
    D
    @jiminy-billy-bob said: it has to consider the window border. macs don't have window borders... available using vanilia.js from one of my webDialogs... outerHeight; 370 outerWidth; 422 pageXOffset; 0 pageYOffset; 0 parent; Window parseFloat; function parseFloat() { parseInt; function parseInt() { personalbar; BarProp constructor; BarPropConstructor visible; false __proto__; BarPropPrototype screen; Screen availHeight; 1174 availLeft; 0 availTop; 22 availWidth; 1920 colorDepth; 24 constructor; ScreenConstructor height; 1200 pixelDepth; 24 width; 1920 __proto__; ScreenPrototype screenLeft; 100 screenTop; 420 screenX; 100 screenY; 420 scrollX; 0 scrollY; 0 scr
  • Using each_slice possible?

    10
    0 Szavazatok
    10 Hozzászólások
    1k Megtekintések
    Dan RathbunD
    You get a NoMethodError because Enumerable does not have that method defined in Ruby 1.8.x. This should do the same, except you pass the array in as the 1st argument: def slicer(ary,num) a2 = ary.dup len = num.to_i.abs until (s = a2.slice!(0,len)).empty? if block_given? yield(s) else puts(s.inspect) end end # until end # slicer() See another example that will collect the slices into an output array, IF a block is NOT given. (Sort of like the opposite to flatten().) If a block is given, it returns an array of the block's return values. Prints to $stdout only if $VERBOSE == true. Fixed absolute call. It is not a Math module function. It is a standard Ruby Numeric instance method.
  • Painting effect

    4
    0 Szavazatok
    4 Hozzászólások
    498 Megtekintések
    mitcorbM
    And now, I recall having looked at this thread. Sorry for any misinformation, and thanks to pbacot
  • Progress bar

    4
    0 Szavazatok
    4 Hozzászólások
    1k Megtekintések
    Chris FullmerC
    SketchUp does that just by writing text to the status bar. a series of | characters to show progress. You can mimic the same behavior, but you do have to re-write it yourself.
  • Multiple objects to groups

    8
    0 Szavazatok
    8 Hozzászólások
    761 Megtekintések
    W
    @chris fullmer said: That was the first script I wrote and published, for this EXACT purpose. You can find it here: http://www.smustard.com/script/Loose2Groups Thanks so much, works perfectly
  • JScript innerHTML not working in WebDialog !

    8
    0 Szavazatok
    8 Hozzászólások
    1k Megtekintések
    S
    @tt_su said: @onidarbe said: So Sketchup uses IE instead of Chrome, although I uninstalled IE? strange You cannot completely uninstall IE. You may have uninstalled the front-end, but the IE engine is embedded deep into the OS. Help files (chm files) are using the HTML engine, HTA files are also using it. And the embedded HTML IE webcontrol is more conservative in terms of compatibility, which is why you need to use META tags to force WebDialogs to use the very latest IE engine. And because so many things use the system HTML engine I recommend you keep IE up to date, even if you use a different browser. You can never remove it 100% anyway. The "uninstaller" is just a shim to please the public (and EU anti-trust). For Mac users, the equivalent statement is that SketchUp uses the WebKit Framework, not Safari. Just as on Windows, your choice of browser has no effect on what SketchUp's WebDIalogs do.
  • .gsub( /\n/, "\n\r" ) not working in WebDialog

    10
    0 Szavazatok
    10 Hozzászólások
    2k Megtekintések
    onidarbeO
    Thanks Dan! But in this case I want for those maybe using my stuff to make it readable in notepad to
  • List of all possible functions

    13
    0 Szavazatok
    13 Hozzászólások
    2k Megtekintések
    tt_suT
    @tig said: I know TT has done some 'shortcut fiddling' with some of his tools [VertexTools?], so pressing M is Move [Vertex] in that tool, rather than invoking the native Move, which already uses that shortcut, and will do so when TT's tool is exited... Perhaps TT can explain what he does to allow that... the files re encrypted... I never modified the shortcuts. What I did in Vertex Tools was that I wanted to activate Vertex Tool's Move tool when vertex mode was activated, and the native Move tool when it was not. So I created a method that did that - but the user still had to reassign it's short-cuts to my proxy-delegating command.
  • Applying new Material to a Selection is extremely slow

    6
    0 Szavazatok
    6 Hozzászólások
    749 Megtekintések
    dkendigD
    good catch
  • Best way to iterate all nested entities

    29
    0 Szavazatok
    29 Hozzászólások
    8k Megtekintések
    dkendigD
    yes, generally this tends to do the trick, but we found that it was a tad faster to have your own lookup table that keeps track of definition relevance. The only downside, is that you are at the mercy of the observer system in that case, but the observers these days seem fairly stable, so that isn't currently an issue.
  • Stairs Ruby?

    9
    0 Szavazatok
    9 Hozzászólások
    1k Megtekintések
    artmusicstudioA
    @martinrinehart said: Google didn't help me find the killer stairs Ruby I was looking for. Is there one? what about this? coming soon..... http://www.youtube.com/watch?v=PMWwlmsmNAs regards stan
  • Material.Texture not working as explained in the doc

    3
    0 Szavazatok
    3 Hozzászólások
    363 Megtekintések
    ppoublanP
    Thanks a lot for your answer. F.....g doc and su apis.
  • Open dialog box

    6
    0 Szavazatok
    6 Hozzászólások
    586 Megtekintések
    tt_suT
    To open it as you would via File > Open: <span class="syntaxdefault">skp_file </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> UI</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">openpanel</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'Choose model to import'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">'*.skp'</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">open_file</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">skp_file</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span> To load it as a component and let the user position it: <span class="syntaxdefault">skp_file </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> UI</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">openpanel</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'Choose model to import'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">'*.skp'</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">unless skp_file</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">nil</span><span class="syntaxkeyword">?<br /></span><span class="syntaxdefault">  model </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model<br />  definition </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">definitions</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">load</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">skp_file</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">  model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">place_component</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">definition</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">end</span> To load it as a component and insert at ORIGIN: <span class="syntaxdefault">skp_file </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> UI</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">openpanel</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'Choose model to import'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">'*.skp'</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">unless skp_file</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">nil</span><span class="syntaxkeyword">?<br /></span><span class="syntaxdefault">  model </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model<br />  definition </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">definitions</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">load</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">skp_file</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">  tr </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> Geom</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Transformation</span><span class="syntaxkeyword">.new<br /></span><span class="syntaxdefault">  model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_entities</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_instance</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">definition</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> tr</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">end</span>
  • Calculate the needed width of a WebDialog

    10
    0 Szavazatok
    10 Hozzászólások
    964 Megtekintések
    onidarbeO
    Thanks! I found the solution... [update 2013-01-23] def popup(msg="", timeOut=0, posX=20, posY=70) # 2013-01-23 onidarbe () gmail # Popup a message (including html-tags & \r) with a timout and auto-resize the window # A click on the popup-window will disable timeOut and has to be closed manually # To see how it's working, add border;1px solid black; in the <div style='...'> htmlCode = %{ <html onclick='clicked();' > <div id='div' style='float;left; white-space;nowrap;' > #{msg.gsub(/\r/,"<br>\n")} </div> <script type='text/javascript'> width=document.getElementById('div').offsetWidth; height=document.getElementById('div').offsetHeight; document.write("<input type='hidden' id='width' value='" + width + "'/>"); document.write("<input type='hidden' id='height' value='" + height + "'/>"); function clicked() { location = 'skp;clicked' }; document.body.scroll = "auto"; </script> </html> } win = UI;;WebDialog.new( "" ) # NOTE; Variables made up on multiple lines have only a \n at the end of each line! # "View source" with Windows Notepad needs to have \r\n win.set_html( htmlCode.gsub(/\r\n|\n\r|\n|\r/,"\r\n") ) # Although WebDialog without pref_key doesn't keep size or location, set_size does! # Thereby start with a smaller window instead of a larger previous version win.set_size( 130, 30 ) win.set_position( posX, posY ) win.show UI;;start_timer( 0, false ) { win.set_size( win.get_element_value("width").to_f+60, [800, win.get_element_value("height").to_f+80].min ) } if timeOut != 0 timerID = UI;;start_timer( timeOut, false ) { win.close } win.add_action_callback( "clicked" ) { UI.stop_timer( timerID ) } end end pluginPath = Sketchup.find_support_file( "Plugins" ) Dir.chdir( pluginPath ) rbFiles = Dir[ "*.rb" ] popup( "<B>All plugins;</B>\r#{pluginPath }\r\r#{rbFiles.join("\r")}", 2 )
  • Method -- Best Naming Techniques

    3
    0 Szavazatok
    3 Hozzászólások
    482 Megtekintések
    Dan RathbunD
    #2 is the Ruby way. (#1 is Javascript or VisualBasic) [#3 is noway!]
  • Rotate face in ruby

    3
    0 Szavazatok
    3 Hozzászólások
    632 Megtekintések
    I
    Thank you very much. This has really been helpful. It was OK the first time I tried This is the end result: [image: moebius.jpg]
  • Dynamic Components reacting to Scene (aka Page) changes

    9
    0 Szavazatok
    9 Hozzászólások
    9k Megtekintések
    G
    Dan , thanks for your help. I will study it.

Advertisement