FredoBend | Powerful new bending tool for SketchUp Download

Subcategories

  • No decscription available

    20 Topics
    462 Posts
    HornOxxH
    @pilou said: More appetizing in chocolate! Eggs are good as well - but only very fragile when falling down in SketchyPhysics
  • How toget a Settings Menu to communicate with a Main Menu?

    18
    0 Votes
    18 Posts
    2k Views
    Dan RathbunD
    @tomot said: ..., I realize that Goto can easily be satisfied using if. No it cannot. @tomot said: My current Ruby already contains some 20 if statements, which are goto's. No they are not branching statements, they are conditional statements. But you CAN make them branch off to some other part of your code, by making method calls, in response to the boolean evaluation of the conditional expressions. if condition_is_true then call_method_one() else call_method_two(); @tomot said: I should be able link via another if statement the sharing of the stored registry value of the @stylewidth in Dialog 1 and Dialog 2.. Again... in a procedural language, a method call (aka procedure call,) takes the place of the old goto from the old sequential linear languages like Fortran and GW-BASIC. Whenever you identify a particular place in your code, that you need to "goto" (usually repeatedly,)... then THAT is the spot where you need to begin a method.
  • Storing last values used in the registry?

    13
    0 Votes
    13 Posts
    2k Views
    TIGT
    The Sketchup.read_defaults and Sketchup.write_defaults use each PC's Sketchup 'Registry' entries OR a MAC's Sketchup 'plist' file entries... so they should work cross-platform. The main issue with using the Registry is storing data restructured into a format that can be recovered and then converted back into the required 'class' later - e.g. a string/float/integer/length/boolean/array/hash etc will need some 'manipulation' before writing - but if you have been using a 'file' to store such things then you've been writing them as strings already - when you reread the file you presumably convert the strings back with say string.to_f to make the value a number etc... [like an 'ini' file]. The Registry data exists across sessions globally for Sketchup on each PC, not just the current SKP. So if you want SKP specific data saving then it's best to use model-attributes to save things with the SKP [you can save attributes as most common data types directly - except a hash] - the data is thereby accessible to all uses on the network when you script reads the attributes as it runs, and later updates the attributes as it closes, this can all be done independent of each PC's Registry entries. Horses for courses...
  • Create new instance of a Ruby object in C?

    12
    0 Votes
    12 Posts
    2k Views
    thomthomT
    After snooping around the Ruby source and looking how it's done there, it looks like this is the way to go: <span class="syntaxdefault">struct Color<br /></span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">  unsigned char red</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> green</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> blue</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> alpha</span><span class="syntaxkeyword">;<br />};<br /><br /></span><span class="syntaxdefault">static VALUE<br />color_to_sketchup</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> Color color </span><span class="syntaxkeyword">)<br />{<br /></span><span class="syntaxdefault">  VALUE mSketchup</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> cColor</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">  VALUE skp_color</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> args</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">4</span><span class="syntaxkeyword">];<br /></span><span class="syntaxdefault">  <br />  mSketchup </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> rb_const_get</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> rb_cObject</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> rb_intern</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> </span><span class="syntaxstring">"Sketchup"</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">  cColor </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> rb_const_get_at</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> mSketchup</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> rb_intern</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"Color"</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">  <br />  args</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">0</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> rb_float_new</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> color</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">red </span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">  args</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">1</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> rb_float_new</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> color</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">green </span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">  args</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">2</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> rb_float_new</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> color</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">blue </span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">  args</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">3</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> rb_float_new</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> color</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">alpha </span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">  <br />  skp_color </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> rb_class_new_instance</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> 4</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> args</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> cColor </span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">  <br />  return skp_color</span><span class="syntaxkeyword">;<br />}</span><span class="syntaxdefault"> </span>
  • Can Sketchup Ruby find the path of a SKM file?

    5
    0 Votes
    5 Posts
    679 Views
    TIGT
    As said... there are currently no access to SKMs in the API [only materials and textures], but my SKMtools do add extra methods to allow you to import a SKM file as anew material, export a material as a SKM file, and do several other things - like extract a SKM's image and thumbnail etc... Search the Plugins Index and get it...
  • Changing cursor insertion point on bounding box

    11
    0 Votes
    11 Posts
    1k Views
    F
    Thanks TIG, I haven't gotten around to trying what you suggested but I will soon enough.
  • Add item to SU main menu

    7
    0 Votes
    7 Posts
    331 Views
    Z
    @unknownuser said: ...add a 'BIM' submenu to the 'Tools' menu and put everything inside that... this way is good ,I hope add "BIM" menu at the SU main menu yet,thanks TIG; and driven's way is very nice! how can do for it ?
  • Ruby access to global delay_time and transition_time

    3
    0 Votes
    3 Posts
    120 Views
    TIGT
    <span class="syntaxdefault">Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">options</span><span class="syntaxkeyword">[</span><span class="syntaxstring">"SlideshowOptions"</span><span class="syntaxkeyword">][</span><span class="syntaxstring">"SlideTime"</span><span class="syntaxkeyword">]<br /></span><span class="syntaxdefault">Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">options</span><span class="syntaxkeyword">[</span><span class="syntaxstring">"PageOptions"</span><span class="syntaxkeyword">][</span><span class="syntaxstring">"TransitionTime"</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span> ???
  • How to call Sandbox tool from ruby script (onselected)

    3
    0 Votes
    3 Posts
    734 Views
    K
    Thanks a lot!!!!!! Hans
  • [Patch] to &quot;sketchup.rb&quot; (beta) v 1.1.0

    10
    0 Votes
    10 Posts
    2k Views
    Dan RathbunD
    @thomthom said: @dan rathbun said: The registration script adds 4 patches to the Preferences (dialog) > Extensions (panel) list. Why have a patch in the extension list? Why would an end user ever need to enable/disable this? Don't you think it can cause confusion? @dan rathbun said: I have separated each patch into it's own file, so it can be switched on/off, tested and updated individually. Formost.. for testing. But as sometimes happens, patches can either introduce other unforseen issues, or perhaps a very popular plugin relies on some quirkiness that the patch fixed. Because it may be large and complex, the author of this "example" popular plugin, needs time to update his code. So the patch can be switched off.. until an update is issued. Patches, in general: I have thought many times upon a patching system, similar to the extension system. I imagine it having it's own checklist, separate from the plugin checklist.
  • Transform texture using ruby

    3
    0 Votes
    3 Posts
    577 Views
    A
    Thank you Taff. I am an admirerer of your work! I have so far modified Gavin's ruby script for this (mentioned above) and got it working, after figuring out how to fit the images onto the faces. I'll post my solution once I clean the code a little.
  • Webdialog position not preserved across session on MAC

    18
    0 Votes
    18 Posts
    3k Views
    OricAtmosO
    @thomthom said: Haven't checked it out, but on PC the position is stored between sessions, but not within sessions. If you make a webdialog, close it, then open it again it doesn't remember the last position - only the last position from last session. Hi, I know this is an old thread, but I think I found out what makes WebDialogs remember their position during one session on Windows. It seems the position is only ever saved when the WebDialog object is destroyed, not when the dialog is closed while the object still lives. That's it, I think.
  • Error checking routine issue?

    10
    0 Votes
    10 Posts
    423 Views
    T
    I understand fully! and that's why your 1 of 3 of my favorite "SU Ruby API goto guys" I also have to include TIG! & thomthom!
  • A faster way to obtain shadow_info?

    4
    0 Votes
    4 Posts
    167 Views
    thomthomT
    It's not actually getting the info that's slow. It's setting it. When I ran the test it took ~11sec to run. When I removed info["ShadowTime"]+=600 it took ~0.15sec to run. That's why I hoped using start_operation would help - but alas. But at least, when you do this, ensure that Shadows are not on in SketchUp.
  • Looping all entities

    7
    0 Votes
    7 Posts
    554 Views
    P
    Excellent information. Thank you ThomThom, much appreciated!
  • Pause/ Hold script for extra user input

    5
    0 Votes
    5 Posts
    908 Views
    M
    Ok, solved it in another way. Thanks anyway. Matt
  • WebDialog Buttons

    19
    0 Votes
    19 Posts
    1k Views
    thomthomT
    I model the virtual keyboard I type on to code my plugins! The model off course generated with ruby code. Oh what a fine conundrum.
  • Beginner Ruby Problmes

    13
    0 Votes
    13 Posts
    2k Views
    thomthomT
    There are some sticky thread in the Developer section where links to various best-practices is posted.
  • Please help with FILLET Plugin

    11
    0 Votes
    11 Posts
    1k Views
    TIGT
    Here's v5.2 of my 2dToolset, containing the updated 2dFillet - arc segments >=2 <=999 - It could go higher [9999] BUT that is crazy bad!] http://forums.sketchucation.com/viewtopic.php?p=185760#p185760
  • Custom units, can it be done?

    8
    0 Votes
    8 Posts
    1k Views
    L
    Wow, that is really exciting! Looking forward to trying it! And I am sure that it will have several uses beyond shaku, I heard they use a plethora of units in India, otherworldly yet widespread units like the angula purportedly equivalent to eight barleycorns side by side.
  • New translate request?

    4
    0 Votes
    4 Posts
    192 Views
    fredo6F
    Then use p3 = p2.offset p2.vector_to(p1), d This gives the point p3, which at distance d of P2 in the direction of p1 Fredo

Advertisement