⚠️ 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
  • [Question]how to load a tool from an external .rb file

    4
    0 Szavazatok
    4 Hozzászólások
    284 Megtekintések
    R
    Thank you Dan. It worked I have started to go through the Ruby Resource as you suggested. And I also found the answer for my own question in there.
  • Combining 2 groups of entities?

    2
    0 Szavazatok
    2 Hozzászólások
    185 Megtekintések
    Dan RathbunD
    begin # model.start_operation('Add nested group') ### OPERATION # editents = model.active_entities() topgrp = editents.add_group() topents = topgrp.entities() group1 = topents.add_group() r_entities = group1.entities() #(add entities to group1 here) group2 = topents.add_group() rr_entities = group2.entities() #(add entities to group2 here) # ### model.commit_operation() # rescue Exception => e model.abort_operation() puts(e.message) puts(e.backtrace) end
  • Auto create an given item at a calculated location? See insi

    2
    0 Szavazatok
    2 Hozzászólások
    173 Megtekintések
    TIGT
    I suggest you read the API... https://developers.google.com/sketchup/docs/ The entities.add_...() methods do want you want... You'll also need to understand Transformations [simple will do!] used to locate some things like 'instances'... and how to create objects like Point3d and maybe Vector3d... There many freely available snippets and full-scripts, that already do what you seek, so there's no need to reinvent the wheel from scratch - just understand what you are doing... I might move this into the Developers' Forum... [EDIT: done.]
  • Component definition list from Ruby vs SU window

    5
    0 Szavazatok
    5 Hozzászólások
    757 Megtekintések
    P
    great, thank you both for the information!
  • Rotating a board into XY plane

    2
    0 Szavazatok
    2 Hozzászólások
    225 Megtekintések
    Dan RathbunD
    John.. I checked the [ Code Snippets ] Index ... ... and I did find this from TIG: [ Code ] Transformation_Extensions
  • Will NOT scramble ??

    44
    0 Szavazatok
    44 Hozzászólások
    4k Megtekintések
    K
    @dan rathbun said: OH wait !! I'll fix the example. Sheesh that was a dumb one. (I had actually tested it with the "load on start" parameter, set to false. So this error did not happen for me in testing.) DONE Now I see the contours of a TEMPLATE for future plugins made in THE RIGHT WAY in a HURRY - that's good practice I think ! Still I have some claims and I'll try figure it out myself before I seek you help
  • Download Plug-In

    7
    0 Szavazatok
    7 Hozzászólások
    439 Megtekintések
    Dan RathbunD
    Since he is using the extended Ruby libraries, with a full Ruby install... @tig said: Instead of trying to deflate the compressed file as it arrives ... why not download the compressed files into a temporary folder ... Net::FTP @tig said: ... then extract their contents ... Zlib @tig said: ... finally move the extracted files to their final destination, and tidy up by erasing the unneeded compressed files and their temporary folder... FileUtils
  • How toget a Settings Menu to communicate with a Main Menu?

    18
    0 Szavazatok
    18 Hozzászólások
    2k Megtekintések
    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 Szavazatok
    13 Hozzászólások
    2k Megtekintések
    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 Szavazatok
    12 Hozzászólások
    2k Megtekintések
    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 Szavazatok
    5 Hozzászólások
    774 Megtekintések
    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 Szavazatok
    11 Hozzászólások
    1k Megtekintések
    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 Szavazatok
    7 Hozzászólások
    477 Megtekintések
    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 Szavazatok
    3 Hozzászólások
    206 Megtekintések
    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 Szavazatok
    3 Hozzászólások
    800 Megtekintések
    K
    Thanks a lot!!!!!! Hans
  • [Patch] to "sketchup.rb" (beta) v 1.1.0

    10
    0 Szavazatok
    10 Hozzászólások
    2k Megtekintések
    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 Szavazatok
    3 Hozzászólások
    641 Megtekintések
    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 Szavazatok
    18 Hozzászólások
    3k Megtekintések
    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 Szavazatok
    10 Hozzászólások
    550 Megtekintések
    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 Szavazatok
    4 Hozzászólások
    258 Megtekintések
    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.

Advertisement