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
  • Extract camera position

    11
    0 Szavazatok
    11 Hozzászólások
    575 Megtekintések
    renderizaR
    @greenskp said: One more thing. Whit this code i can get camera target position? Dan Rathbun posted a ref link that have things like target, direction, ect example ptarget = @@model.active_view.camera.target ; @greenskp said: It´s possible that to each Scene created i have different coordinates? Not sure what you mean by this. If you click remember camera position in scene manager then yes you will change camera placement with scene. Cheers! Note: Thanks thomthom for explaining why that happened!
  • [code] Is there a way to know if cursor on top of shadow?

    12
    0 Szavazatok
    12 Hozzászólások
    731 Megtekintések
    Dan RathbunD
    ... because in a boolean expression nil (and false,) eval falsely. Everything else including true, [] (an empty array), and 0 (the integer zero,) evaluate truthfully.
  • How to display Vertex and change color when selected?

    10
    0 Szavazatok
    10 Hozzászólások
    793 Megtekintések
    Dan RathbunD
    Don't put spaces between method names and their argument lists when you surround the list with** ( )** Ruby generates a warning for every line that has the unneeded space.
  • [code] Sketchup Safe Shutdown method

    10
    0 Szavazatok
    10 Hozzászólások
    6k Megtekintések
    D
    censored
  • TextureWriter filename - empty response

    5
    0 Szavazatok
    5 Hozzászólások
    669 Megtekintések
    B
    There appears to be a software defect in the SketchUp API. Loading the textures into TextureWriter and then attempting to access their filenames using TextureWriter.filename(index) returns only empty strings. However, if you call TextureWriter.write_all beforehand: # Display texture names def display_tex_names $tw = Sketchup.create_texture_writer load_textures(Sketchup.active_model.entities) $tw.write_all("D;", false) tex_index = 1 while (tex_index <= $tw.count) UI.messagebox($tw.filename(tex_index)) tex_index += 1 end Sketchup.active_model.commit_operation end then the filenames are returned properly. Confusing matters further, the TextureWriterindices are one-based rather than the expected zero-based array.
  • How to select last entity selected?

    6
    0 Szavazatok
    6 Hozzászólások
    384 Megtekintések
    renderizaR
    I have tried but seems I can't get it to work or understand correctly. Is there a sample code that can better illustrate this. Thanks!
  • Ruby method to calculate the area of an intersection?

    3
    0 Szavazatok
    3 Hozzászólások
    669 Megtekintések
    Dan RathbunD
    Assuming f is the reference to the intersecting face object: a = f.area() See the API Face class.
  • [Code] intersect_with?() Group test method

    2
    0 Szavazatok
    2 Hozzászólások
    1k Megtekintések
    B
    Hi, May I know after determining if the 2 groups/ components/ faces are intersected. How do I get the area of the intersection?
  • How to recognize cursor on top of texture?

    6
    0 Szavazatok
    6 Hozzászólások
    406 Megtekintések
    thomthomT
    @unknownuser said: Add:: On Material - I am actually happy that the default material returns nil because it may pass as a mask feature But this line will cause an error: if flags == 1 && @@sel != nil && @@texture_addon == true && selected_face_mat.texture != nil If selected_face_mat is nil then you cannot call .texture on it.
  • Geom.intersect_line_line question

    15
    0 Szavazatok
    15 Hozzászólások
    1k Megtekintések
    thomthomT
    Then it sounds like moving to an Ruby C Extension is what might give real performance improvements.
  • Shortcut key(s) for a plugin(s)

    9
    0 Szavazatok
    9 Hozzászólások
    708 Megtekintések
    Wo3DanW
    @thomthom said: Gerrit, you mean like my Vertex Tools? Where it offers a set of Move, Rotate and Scale tools for vertex editing? ....... Thank you Thomas. No, I meant the most basic thing where, once a plugin is loaded at startup of SketchUp, the plugin is right available in the menu where you let it appear. And at the same time the plugin can (from thereof) also be reached if you assign a shortcut key to it. I wasn't sure whether "placing in the list" was done automaticaly or if you need to have some extra code in the plugin for the list. Example: I place plugin "AAA" in the folder. Looking at the code I see that "AAA" will show up in menu say "Draw". Looking at the shortcut list I can see that I can assign its use to a key. In my case I don't want to use my plugin through any menu but (say lazy as I am) by hitting a key. As it seems SU handles most of that for me. As long as I let it appear in a menu and than find it in the list of shortcuts for assigning it. Thank you Aerilius, for confirming TIG's answer. The idea I have (and have had for a long time) is simple and takes all you writers about two minutes to write. I just want to put this together myself, as simple as the idea is. Otherwise I'll never learn.
  • Exit plugin from within a function

    4
    0 Szavazatok
    4 Hozzászólások
    373 Megtekintések
    Dan RathbunD
    @mattc said: def initialize() > sel=Sketchup.active_model.selection > SPP;;test_start > SPP;;check_selection(sel) > SPP;;test_end > end (4) The above is not correct. The initialize() method is only used in a class definition, where you wish to let the user create MANY instances of the object. Users will not need to create many copies of your plugin. Most plugins are code that needs only one copy, .. so it should be a module (inside your author module.) But a plugin module can have (and often does,) use custom class definitions and instances inside it's module. Later on, you will likely be creating a custom Tool class inside your plugin module.
  • RubyAPI - UI timers

    15
    0 Szavazatok
    15 Hozzászólások
    12k Megtekintések
    Dan RathbunD
    @aerilius said: I've done similar experiments and found evidence that Threads do (partially) work. And ... in PC SketchUp prior to v8, it distro'd with Ruby v1.8.0 in which the Thread class was very unstable. But threads have gotten more stable in Ruby versions above v1.8.6, even more so in the v1.8.7 branch. Keep in mind that all the Mac Sketchup editions still disto with Ruby v1.8.5 (initial release.) Usually .. coders wish to use threads in order to prevent SketchUp from blocking. As ThomThom said.. threads in the Ruby 1.8.x trunk are green threads (still within SketchUp's process.) Read the description of Green Threads at wikipedia. DITTO what TIG said.
  • Multiple dialog scope issue on the PC

    24
    0 Szavazatok
    24 Hozzászólások
    1k Megtekintések
    Dan RathbunD
    @honkinberry said: The javascript:void(0) is the recommended practice, indicating that the onclick handler is to take precedence. I disagreed 3 years ago when we discussed this issue, and still do. Read my detailed explanation in this old thread: Webdialogs and Javascript void Any more discussion on this offtopic, can be done in that thread, if you wish.
  • [Code] User::ToolbarSet collection

    4
    0 Szavazatok
    4 Hozzászólások
    432 Megtekintések
    Dan RathbunD
    UPDATED code in 1st post to v2.0.1, in refresh() method's next statement to avoid a vicious loop. (We use Hash#has_key?(key) rather than Hash#[key]!=nil, because our v2.0.0 update makes the [] method call the refresh method, so we must be very careful from within the refresh method that any [] method call does not cause a unwanted or unneeded, call to refresh.)
  • Md5 hash or similar in SU Ruby?

    10
    0 Szavazatok
    10 Hozzászólások
    2k Megtekintések
    Dan RathbunD
    Personally I have just used a Ruby %x call using the fciv.exe command line checksum utility that I believe came with the Windows Support Tools. fciv stands for File Checksum Integrity Verifier: Microsoft Download: File Checksum Integrity Verifier
  • Load Toolbars

    7
    0 Szavazatok
    7 Hozzászólások
    489 Megtekintések
    Dan RathbunD
    @burkhard said: Found a workaround. It needs to be refresh, ... So, if a Toolbar is not loaded, it works after refresh the hash. The Toolbar WAS loaded, but UI::Toolbar references are NOT automatically added into the custom User::ToolbarSet hash. SO.. I created the UI::Toolbar.refresh() method to find any new toolbars (created after the hash was populated,) and add them. I WILL NOT modify the API's UI::Toolbar class constructor method, in a public script, because I feel it is a violation of the API Terms of Use. BUT perhaps we can modify the User::ToolbarSet hash's [] method's error Proc, so that it refreshes the hash automatically. See: http://sketchucation.com/forums/viewtopic.php?f=180&t=51432&p=466742#p466742
  • Test array generation...

    3
    0 Szavazatok
    3 Hozzászólások
    245 Megtekintések
    D
    TT added commenting to the original code block to try and explain things better, I can't get the formatting to hold... but this is better. john
  • [Info] WebDialogs - The Lost Manual on GitHub

    5
    0 Szavazatok
    5 Hozzászólások
    407 Megtekintések
    thomthomT
    @mptak said: I think this will inspire me to finally make the leap fully into github! Excellent! I'd really like to see the SketchUp community making more use of tools such as GitHub and BitBucket etc.
  • Organising namespaces and loading scripts on demand

    7
    0 Szavazatok
    7 Hozzászólások
    528 Megtekintések
    thomthomT
    <span class="syntaxdefault"><br />filter </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> File</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">dirname</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">File</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">dirname</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">__FILE__</span><span class="syntaxkeyword">),</span><span class="syntaxdefault"> </span><span class="syntaxstring">'*.rbs'</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">for filename in Dir</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">glob</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">filter</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">  eval</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"Sketchup;;require('#{filename }', TOPLEVEL_BINDING, '#{filename}', 1 )"</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">end<br /></span> ?

Advertisement