Sketchucation Tools 5.0.7 | Licensing improvements and bug fixes Learn More

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
  • Webdialog on Mac

    2
    0 Votes
    2 Posts
    147 Views
    thomthomT
    It's not modal, no. It makes the window stay on top of the SketchUp windw (which is what Windows does in all cases.) For my CleanUp plugin I worked around it by creating a tool where I hooked up the deactivate event to close the dialog. That also captures the mouse events so users can't click randomly in the model and change it while the tool and dialog is active. On SU8+ I also draw a semi-transparent polygon over the whole viewport to dim it. Source code for the tool wrapper is here: https://bitbucket.org/thomthom/tt-library-2/src/5ec87b0647c953c397b605922f31d5dbe21ad548/TT_Lib2/modal_wrapper.rb?at=Version%202.7.0
  • Force a redraw after a value is entered in the vcb?

    2
    0 Votes
    2 Posts
    335 Views
    TIGT
    A selection-observer to see if it contains DC instance[s] ? A tools-observer to see if Scale in active && @check1 gives you @check2 ?? Now an entities-observer if @check2 looking at the DC[s] looks for any changes, gives check3 ??? If @check3 then call something like: <span class="syntaxdefault">def dc_redraw</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">ent</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> pbar_visible</span><span class="syntaxkeyword">=</span><span class="syntaxdefault">true</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> undo</span><span class="syntaxkeyword">=</span><span class="syntaxdefault">false</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">    ldc</span><span class="syntaxkeyword">=</span><span class="syntaxdefault">$dc_observers</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">get_latest_class</span><span class="syntaxkeyword">()<br /></span><span class="syntaxdefault">    if undo<br />        ldc</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">method</span><span class="syntaxkeyword">(;</span><span class="syntaxdefault">redraw_with_undo</span><span class="syntaxkeyword">).</span><span class="syntaxdefault">call</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">ent</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> pbar_visible</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">    else<br />        ldc</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">determine_movetool_behaviors</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">ent</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">        DCProgressBar</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">clear</span><span class="syntaxkeyword">()<br /></span><span class="syntaxdefault">        ldc</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">method</span><span class="syntaxkeyword">(;</span><span class="syntaxdefault">redraw</span><span class="syntaxkeyword">).</span><span class="syntaxdefault">call</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">ent</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> pbar_visible</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">        DCProgressBar</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">clear</span><span class="syntaxkeyword">()<br /></span><span class="syntaxdefault">        ldc</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">refresh_dialogs</span><span class="syntaxkeyword">()<br /></span><span class="syntaxdefault">    end<br />    </span><span class="syntaxkeyword">@</span><span class="syntaxdefault">view</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">refresh<br />    rescue TypeError </span><span class="syntaxkeyword">=></span><span class="syntaxdefault"> e<br />    </span><span class="syntaxcomment"># suppress nil to float conversion error that happens<br /></span><span class="syntaxdefault">    </span><span class="syntaxcomment"># when redraw is called directly with true 2nd arg ?<br /></span><span class="syntaxdefault">end</span><span class="syntaxcomment">#def<br />### so it&nbsp;is&nbsp;NOT; $dc_observers.get_latest_class.redraw_with_undo(dc)<br />### it's; self.dc_redraw(dc, true, false)&nbsp;</span><span class="syntaxdefault"></span>
  • [JS] Global variables

    3
    0 Votes
    3 Posts
    286 Views
    jolranJ
    Thank you Thomthom. I think you answered all my questions. @unknownuser said: All is restricted to the scope of the HTML page loaded This was my main concern. I don't want to pollute other people's plugins if I create a global var. @unknownuser said: Namespacing is still good when you want to use other libraries, you then want to ensure you do not conflict. Ah, I think I understand now. Like if you create a Jquery plugin for public release, for ex? @unknownuser said: But as of TT_Lib, which is a library I have namespaced it because it's mean to be used in different environments. A, yeah. I forgot for a minute it was a library when I was pooking around. Your library is a very useful resource for me, since you are using Jquery .
  • Rbs weird behaviour on modules

    4
    0 Votes
    4 Posts
    232 Views
    S
    Ok, thanks for the workaround. You should expect that no mather you use rb's or rbs's, they behave the same way...
  • Boolean operations

    20
    0 Votes
    20 Posts
    12k Views
    cottyC
    @gonashvili said: actually no Hey, nobody knows everything, thats why I'm on here Then you are right here...
  • ENV['COMPUTERNAME'] for Mac?

    16
    0 Votes
    16 Posts
    2k Views
    D
    @honkinberry said: Jim is correct! hostname does indeed work. but that returns the same on all 5 macs on my network, so for a Licence management usage it seems a bit pointless? If you only need to know if it's a mac or not there are many simple ways to get that... glad your happy john
  • Questions about realization of tools

    20
    0 Votes
    20 Posts
    998 Views
    D
    is true, on several occasions have been very frustrating these examples [image: Bgt9_computadoragolpes.gif]
  • (Webdialog) Window match clientsize.

    19
    0 Votes
    19 Posts
    934 Views
    D
    @jolran said: Sounds really advanced. Responsive window. it's a prototype that seems to work on my mac, might find an excuse to finish it one day. john
  • Help with transformation

    14
    0 Votes
    14 Posts
    821 Views
    D
    Posted the first vertion of the importer at http://sketchucation.com/forums/viewtopic.php?f=323&t=50067
  • Exporting solids &amp; reversed faces

    5
    0 Votes
    5 Posts
    315 Views
    N
    No, just lines and using methods like Geom::intersect_line_plane and then checking weather the intersection lies withing the face itself. It's complicated and error prone (When lines intersect edges instead of faces) but can be made to work.
  • Empty groups get deleted?!

    19
    0 Votes
    19 Posts
    1k Views
    Chris FullmerC
    @niccah said: The user would like to create a project => so, somewhere I have to save this information about the projects (name, options, etc, ..). And the user could create a project and close Sketchup => so, the information about the new project has to be saved somewhere "for ever". Use an attribute dictionary to attach information to the model. It will stay with it after the model is closed and opened. Single Dictionatires http://www.sketchup.com/intl/en/developer/docs/ourdoc/attributedictionary Collections of multiple dictionaries http://www.sketchup.com/intl/en/developer/docs/ourdoc/attributedictionaries This is a much more stable way to maintain data in the model from session to session. Chris
  • SKP write thumbnail. SIZE?

    7
    0 Votes
    7 Posts
    636 Views
    jolranJ
    Maybe not for this part. I already have a folder with components. But your code might be very useful for a different projekt I have. This code would have to run each time to see if the user has added new components, when launching the webdialog. And add thumbs to the list. I already had it working before with 128 px X 64 px, but it would be nice to be able to set the thumbs proportions. As of now I'm clipping the image in CSS with 2 divs. Never mind how I'm doing it BTW.. The main point is that I may not be able to support IE7 with several imagehacks. BTW a side question: Trying to stay "Sketchup like" with the dialog. Could there be any copyright issues, mimicing Sketchup GUI interface?
  • ( [ 0,0,0 ].vector_to( [ 0,0,0 ] ) ).length.mm &lt; 0.01.mm

    6
    0 Votes
    6 Posts
    280 Views
    D
    Very informative site in did. Thank you. I am a hardware engineer by training - so I know this problem from the other side and still it is a little strange
  • Rounding numbers

    7
    0 Votes
    7 Posts
    610 Views
    thomthomT
    @genma saotome said: Seems like updating the version of ruby used for Sketchup would he most helpful. Any reason for Trimble to do that as a routine step or is this one of those don't fix it if it ain't broke situations? They've tried earlier, but it was troublesome. However, from the talks at Basecamp it did appear they are again looking to update the Ruby core.
  • My first script

    3
    0 Votes
    3 Posts
    468 Views
    thomthomT
    To get input data from the mouse you got either InputPoint class or PickHelper. It depends what you are looking for. InputPoint gives you inferences is is similar to what for instance the Line tool uses. PickHelper is more for being abel to select Entities. Either way, You want to oolk into the Tool class. As for units which jolran mentioned, I got an overview of how to deal with units in SU here: http://www.thomthom.net/thoughts/2012/08/dealing-with-units-in-sketchup/ You basically should not do so much work with it. Keep everything in inches, the internal units, preferable in the Length class and let SU do the work of converting back and forth between internal units and model units.
  • Add items to submenu later on

    11
    0 Votes
    11 Posts
    1k Views
    Dan RathbunD
    The two main problems we have: (1) Menu object references on the C++ side are garbage collected quite quickly, and the references on the Ruby-side become invalid. We can live with having to recall UI.menu() to get new valid references to the 9 top level menus, but ... (2) the menu#add_submenu method should return a new valid reference to the submenu IF IT ALREADY EXISTS, or create the submenu if it does not. Currently it just creates a duplicate submenu. I am sure that this issue has already been logged. I so much hope that SketchUp v2013 will fix this (if no more updates to v8 will be released.) So.. for now... once the startup cycle is complete, we cannot add items to ANY of the previously created submenus.
  • One Submenu for many plugins

    4
    0 Votes
    4 Posts
    743 Views
    Dan RathbunD
    Although this should work.. because of current API bugs. It will not. See thread: http://sketchucation.com/forums/viewtopic.php?f=180&t=49912&p=449979#p449362
  • Get Point3D from place_component

    6
    0 Votes
    6 Posts
    372 Views
    F
    @dan rathbun said: Now... model#place_component() (1) The API dictionary is incorrect, it does NOT return nil, it returns a reference to the active_model which is basically frivolous, but does allow call chaining. We have logged an API doc typo on this, as well as asking for something more useable to be returned (especially in the case of multiple insertions when the 2nd argument is true.) (2) When the 2nd argument is false, and only 1 instance is inserted, model#place_component() works the same as the native tool, ie: the selection is cleared, and the newly placed component instance's reference is pushed into the selection (as it's only member.) So you can get it's insertion point as discussed in the post above. FYI ... When the 2nd argument to model#place_component() is true, and multiple instances MIGHT HAVE BEEN inserted, the model's selection object IS NOT CHANGED. If something was previously selected, it still is. If the selection was empty, it will still be empty. Dan, thank you for you for your two posts which are very helpful. I would have ticked them both as 'resolve' but I had already done this for a previous post and 'the system' wouldn't allow me to tick more than one post as a 'resolved' post. I will be trying your ideas soon. Thanks again. Francis
  • Scale along custom axis

    10
    0 Votes
    10 Posts
    2k Views
    Dan RathbunD
    If that works (and likely it does 'cause it's Adam talking,) can it be moved to the first post, retitled as a snippet topic, and comments inserted explaining WHY it works ?
  • SketchUp Engine

    7
    0 Votes
    7 Posts
    1k Views
    AdamBA
    Yes. But on a Mac, use Activity Monitor and click "Sample" to see this.

Advertisement