⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
  • JS - HTML error

    6
    0 評價
    6 貼文
    201 瀏覽
    Chris FullmerC
    Excellent, thanks Dan. It is working as expected, but I'm still very confused what the error was. This code works: id = "113" t = %Q^<form><input type="button" value="Click me!" id="#{id}" onclick="change_time(this.id)" /></form>^ But this one causes errors: id = "113" t = %Q^<form><input type="button" value="Click me!" onclick="change_time('#{id}')" /></form>^ As I've been playing with it over and over, it seems everytime I introduce the single quote into the function arguments, it crashes. But I'm doing it that was in other very similar onclick functions. Oh well, its beyond me. Thanks for helping everyone, I've got a wokring version now! Chris
  • Accessing Match Photo feature with the Ruby api

    4
    0 評價
    4 貼文
    388 瀏覽
    Dan RathbunD
    @jrudd said: Any idea what the make_pano_pm.rb file does? @unknownuser said: Creates a set of photo matched pages given a series of panoramic images. Also creates a box (using create_box) which makes it easier to start sketching over top of the images. In the last edition of CatchUp (#5), was a article entitled: "INTERIOR DESIGN how to make a look around background" (midway thru the zine, just after "MAYOR MIKE’S GADGETS" section.) http://78.47.159.221/CatchUp_5_2011_10.pdf
  • Import image with only front face visible.

    3
    0 評價
    3 貼文
    197 瀏覽
    J
    @tig said: Add the Image inside a new empty group group.entities rather than the model... Manipulate the Image size etc as desired Explode the Image. You now have a face inside the group.entities Find the face in the entities - there's only one. Leave the face.material as it is [i.e. the image now made into a texture]. Make face.back_material=nil to use the 'default back material' or say use face.back_material="Black" to make it 'black'... That did it! Genius, TIG!!
  • BoundingBox.depth. Accurate?

    4
    0 評價
    4 貼文
    171 瀏覽
    jolranJ
    Ah, thanks. Doing some tiling with thoose mesurements. Should be ok then.. @unknownuser said: The internal unit is converted to user units only in the UI That's why I got back different results in the ruby console when changing the Model precision. Maybe that goes for some other mesurement as well, havent just thought about it until now. @unknownuser said: When dealing with user units, make the Length class do the work for it. And make sure you know if your objects are Floats or Lengths. I'll try to stick to that.
  • Getting Ruby to work on Mac

    13
    0 評價
    13 貼文
    771 瀏覽
    D
    @dan rathbun said: If I was a Mac only user, I'd be raisin' hell... getting a petition going, or similar to get the Mac Sketchup Ruby updated (at least equal to that of the PC.) It would be nicer if both platforms were updated to the latest patch in the 1.8.7 trunk. I am in the process of raising hell to Google... @dan rathbun said: It would be beneficial if you could figure out a way, to install an additional frameworkized v1.8.7 Ruby beneath (alongside) the Sketchup obsolete Ruby, and then have a "switching" utility that allowed the user to change the symbolic links, to load the newer Ruby. Sigh... these convoluted workarounds are getting old. I think it will be resort to using shell commands instead of the Ruby libraries I need. Mac comes with curl and gzip, and I believe this will eliminate my need for stringio as well. Thank you for your input Dan. I will pass this on to Google.
  • ModelTranslation[X,Y,Z]

    4
    0 評價
    4 貼文
    422 瀏覽
    P
    I seem to have determined the units of the ModelTranslation values - inches. My problem now is to reset the z-axis of the model to make it easier to calculate elevations. For instance, I want to show the impact of a flood which reached a certain height. That height is given in AHD (Australian Height Datum) relative values. I presume that the location data elevations are also AHD-relative. I can represent a flood by drawing a rectangle centred on 0,0,0 and pulling the surface up to the height of the flood. The idea works well, apart from some apparent inaccuracies in the terrain data. However, it is far easier to simply pull the "water" to a given height in metres, than to convert the height to inches, subtract the Z translation in inches, then reconvert the difference to metres to calculate a level relative to 0,0,0 to pull to. Flood level
  • (solved)locked files

    7
    0 評價
    7 貼文
    1k 瀏覽
    jolranJ
    OOPs There was a typo in my code. Now the comps are loading(hopefully). Forget the last post. Edit: Problem solved by saving components(like Dan said) in user/my documents/anyfolder. Then I can copy and paste from there.
  • Mac Toolbars Editable?

    15
    0 評價
    15 貼文
    3k 瀏覽
    H
    @driven said: jim, thom you can edit the nibs on NSPanels, and I guess you could change the content if you know all the tool codes... [attachment=0:1e21rm0n]<!-- ia0 -->tool palettes .jpg<!-- ia0 -->[/attachment:1e21rm0n] john hi i want this can you show me how?
  • How to force IE 8 or 9?

    4
    0 評價
    4 貼文
    244 瀏覽
    thomthomT
    Yea, all kinds of stranges rules comes to play when an embedded webcontrol is used. ...and it's damn hard to find anything documented.
  • [C\C++] SketchUp window handle

    12
    0 評價
    12 貼文
    996 瀏覽
    thomthomT
    Here's a way that doesn't iterate every windows there is. It enumerates the windows of the calling thread. Cuts down the searching and ensure that you don't get the wrong window. win32_sketchup_window.rb
  • Colors and values

    10
    0 評價
    10 貼文
    543 瀏覽
    thomthomT
    @chris fullmer said: Thom gave a great example with some if loops I think that let you blend the entire rainbow smoothly from red to pink to purple to blue to cyan to green to yellow then orange and back to red. I'd have to search a ways back to think where that was posted though. I couldn't find the example I posted earlier either, so here it is again: <span class="syntaxdefault"><br /></span><span class="syntaxcomment"># Soft Selection Colour Map<br /># Colours to translate to. First is max, last is bottom.<br /></span><span class="syntaxkeyword">@</span><span class="syntaxdefault">clr </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">[]<br />@</span><span class="syntaxdefault">clr </span><span class="syntaxkeyword"><<</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Color</span><span class="syntaxkeyword">.new(</span><span class="syntaxdefault">255</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">  0</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">  0</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxcomment"># 100%<br /></span><span class="syntaxkeyword">@</span><span class="syntaxdefault">clr </span><span class="syntaxkeyword"><<</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Color</span><span class="syntaxkeyword">.new(</span><span class="syntaxdefault">255</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">255</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">  0</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxcomment">#  75%<br /></span><span class="syntaxkeyword">@</span><span class="syntaxdefault">clr </span><span class="syntaxkeyword"><<</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Color</span><span class="syntaxkeyword">.new(</span><span class="syntaxdefault">  0</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">255</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">  0</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxcomment">#  50%<br /></span><span class="syntaxkeyword">@</span><span class="syntaxdefault">clr </span><span class="syntaxkeyword"><<</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Color</span><span class="syntaxkeyword">.new(</span><span class="syntaxdefault">  0</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">255</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">255</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxcomment">#  25%<br /></span><span class="syntaxkeyword">@</span><span class="syntaxdefault">clr </span><span class="syntaxkeyword"><<</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Color</span><span class="syntaxkeyword">.new(</span><span class="syntaxdefault">  0</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">  0</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">255</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxcomment">#   0%<br /></span><span class="syntaxdefault">def self</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">clr</span><span class="syntaxkeyword">;</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">@</span><span class="syntaxdefault">clr</span><span class="syntaxkeyword">;</span><span class="syntaxdefault"> end </span><span class="syntaxcomment"># Accessor<br /># (?) Should this be done by CExt?<br /></span><span class="syntaxdefault">def self</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">value_to_color</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">value </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> 0</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> max </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> 100</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> min </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> 0</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> clr </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">@</span><span class="syntaxdefault">clr</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">  </span><span class="syntaxcomment"># Cap value to range.<br /></span><span class="syntaxdefault">  value </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">[</span><span class="syntaxdefault">min</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> value</span><span class="syntaxkeyword">].</span><span class="syntaxdefault">max<br />  value </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">[</span><span class="syntaxdefault">max</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> value</span><span class="syntaxkeyword">].</span><span class="syntaxdefault">min<br />  </span><span class="syntaxcomment"># Calculate what colours to blend between and the blending ratio.<br /></span><span class="syntaxdefault">  n </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">value</span><span class="syntaxkeyword">-</span><span class="syntaxdefault">min</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">/</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">max</span><span class="syntaxkeyword">-</span><span class="syntaxdefault">min</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">/</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">clr</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">length</span><span class="syntaxkeyword">-</span><span class="syntaxdefault">1.0</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">  index1 </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> n</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">to_i<br />  index2 </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">[</span><span class="syntaxdefault">index1</span><span class="syntaxkeyword">+</span><span class="syntaxdefault">1</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> clr</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">length</span><span class="syntaxkeyword">-</span><span class="syntaxdefault">1</span><span class="syntaxkeyword">].</span><span class="syntaxdefault">min<br />  ratio </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> n </span><span class="syntaxkeyword">-</span><span class="syntaxdefault"> index1<br />  return clr</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">index2</span><span class="syntaxkeyword">].</span><span class="syntaxdefault">blend</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">clr</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">index1</span><span class="syntaxkeyword">],</span><span class="syntaxdefault"> ratio</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">end<br /></span> That's the method I use in Vertex Tools to colour the soft selection: [image: KA9c_clr.png]
  • Javascript problem

    8
    0 評價
    8 貼文
    453 瀏覽
    T
    Thanks for you responses! And yes you are right, I need to organize my scripts better, you've been of great advice!
  • Ruby Code Generator

    5
    0 評價
    5 貼文
    651 瀏覽
    Dan RathbunD
    And I see you just joined SCF, so I'll assume your new to Ruby... see: Ruby Newbie's Guide to Getting Started Get the CHM Ruby Reference, as instructed in the Guide... Get the full Ruby installer: Ruby (v1.8.6-p287) Windows One-Click Installer Get the !loadpaths.rb script (so you can access standard Ruby lib files): [Code] Ruby LOAD PATHs script (Win32) (Dan Rathbun / Jim Foltz)
  • JQuery 1.7 Released

    4
    0 評價
    4 貼文
    243 瀏覽
    jolranJ
    Yes, I understand. I've seen your praising for it. That made me want to try to learn it in addition to standard JS. Can say.. Haven't been using Jquery for long(or JS for that matter), but only the selectors themself is worth the use of it.
  • C Extension project - Async HTTP transfer - CURL?

    10
    0 評價
    10 貼文
    2k 瀏覽
    T
    @adamb said: Ruby has "green threads" which is simply the Ruby interpreter locally slicing & dicing its own execution thread. But since the Ruby intepreter itself is being scheduled from the runloop of SketchUp, its of little use for asyncronous work. In other words, if I have a progress bar inside a C extension, it will suffer same 'halt' as whole SU user interface, when Ruby is doing heavy lifting, right? Does it mean that I have to start an independent thread with the progress bar to have it updated in same conditions?
  • Temporary drawing elements vs. invisible objects

    2
    0 評價
    2 貼文
    264 瀏覽
    thomthomT
    Creating entities in SketchUp is slow! Very slow and it gets slower the more entities you have in the context. It also triggers all kinds of observers etc. If possible, avoid any kind of calculations without temp geometry. ( Some times you have to, like when you want to trigger SU's merge feature to make sure things heal up properly. Or if you need to get the current user axis - then you need to create two dummy groups.) And yes, using the built in methods of SU for calculations is much faster than trying to do it in Ruby. Make use of the Geom module for all it's worth. For Vertex Tools I even ported the method that calculated soft selection to a C extension because in Ruby it was slow as a sleeping snail. Any calculation, even simple 2 + 2 operations eat time in Ruby - which you notice quickly when you do it in a look. But the biggest bottleneck is adding entities in SU, and that's not much you can work around other than trying to use the bulk methods whenever possible.
  • Mac ruby editor

    5
    0 評價
    5 貼文
    496 瀏覽
    gillesG
    there is one that is a SU plugin http://forums.sketchucation.com/viewtopic.php?t=25800#p222075
  • Unified Info for Noobies? Wiki?

    5
    0 評價
    5 貼文
    312 瀏覽
    thomthomT
    That sounds good. Though, might be good to start simple, just so that it doesn't get so complex it'll never finish. (I've been there soooo many times... )
  • Parameter passing across two files

    3
    0 評價
    3 貼文
    172 瀏覽
    C
    Great! Thank you Dan.
  • Installers for plugins.

    11
    0 評價
    11 貼文
    1k 瀏覽
    D
    A lightweight solution for plugin installers is to use self-extracting zips: http://www.izarc.org/tutorials.html#sfx izarc gives you a few basic options as well. You'll have to make separate installers for 32/64bit Windows (since 64-bit systems use C:\Program Files (x86)).

Advertisement