⚠️ 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
  • Selection.add ??? possible?

    4
    0 Szavazatok
    4 Hozzászólások
    491 Megtekintések
    tt_suT
    Was that a question on how? Or did you experience issues with Selection.add (because that is exactly the API method to do what you requested: http://www.sketchup.com/intl/en/developer/docs/ourdoc/selection#add)
  • UI exit ruby?

    4
    0 Szavazatok
    4 Hozzászólások
    807 Megtekintések
    artmusicstudioA
    hi and thanx to both, @ tig: yes, i also use puts-tags to follow the code in the console , whit line-number-output to see, in which code -line the puts is. i will try out all the break, next etc. functions. thanx for this? and @tt_su yes, interaction with the viewport was exactly, what i hoped for, so i could inspect the geometry at any stage ot the running code. (break - inspect geometry - go on....). the rest is still tooooo 'high' for me, although i already 'speak' a bit ruby...-:) stan
  • Read and Write (update) problem

    12
    0 Szavazatok
    12 Hozzászólások
    1k Megtekintések
    S
    Thanks to every one here (and also Thomas Thomassen) the work is now finished! https://www.youtube.com/watch?v=xQOgv2OedJM
  • How do I run send_action for a custom menu item

    4
    0 Szavazatok
    4 Hozzászólások
    664 Megtekintések
    TIGT
    You can't use the script's code if it's inside an encrypted RBS, but if the Extension menu/toolbar-maker is in a RB, then you can read it to see what it's doing... You have to do some detective work... If we knew this 'secret' extension then we could comment more constructively
  • Puts inconsistency & machine epsilon management

    20
    0 Szavazatok
    20 Hozzászólások
    2k Megtekintések
    Dan RathbunD
    There are some class level constant settings for the Float class. List them: Float.constants Example: Float::DIG 15
  • Full ruby installer

    14
    0 Szavazatok
    14 Hozzászólások
    2k Megtekintések
    R
    It worked beatifully. The only thing I had to change was a line of code where I use 'angle_between'. I just created a temporary Vector3D and solved the issue. I had to switch to Marshal because files were getting too big (180MB) and it was taking 15 minutes just to save.
  • [solved] merging two triangle faces of a mesh-square

    4
    0 Szavazatok
    4 Hozzászólások
    936 Megtekintések
    artmusicstudioA
    hi tt, to finish this topic, i learned how to identify a surface and handle its parts (faces) and now i can manupulate its elements, as needed. thanx to all in this topic for helping and ttheir ideas. stan
  • How to use special characters in filenames like æøå

    3
    0 Szavazatok
    3 Hozzászólások
    406 Megtekintések
    R
    Hej Thom, Then it sounds like I have to switch to Sketchup 2014
  • Retrievin object's absolute height ??

    18
    0 Szavazatok
    18 Hozzászólások
    2k Megtekintések
    jolranJ
    Dats true. But I don't understand why you opt to create a new Array for each edge instead of a ternary
  • How to save the model to a file?

    7
    0 Szavazatok
    7 Hozzászólások
    623 Megtekintések
    Dan RathbunD
    @rvs1977 said: @sdmitch said: I use Sketchup 8.0.15158 - Maybe thats why...? Yes.. as I said above, prior to SKetchUp 2014, we had to make sure ENV["HOME"] was set ourselves (as I showed above.) Ruby needs it set.
  • Get registry string from ruby 2.0

    8
    0 Szavazatok
    8 Hozzászólások
    1k Megtekintések
    Al HartA
    @dan rathbun said: @al hart said: Thanks Dan - that works! WHAT works ? (I talked about at least 3 ways.) We wound up using win32ole and RegRead However we ran into problems with an uncaught exception when the Registry Key we passed did not exist, so we added a second rescue for the second registry key. Like this (I added XX to the key to intentionally make it fail) require "win32ole" wsh = WIN32OLE.new("WScript.Shell") begin val = wsh.RegRead("HKLM\\Software\\Wow6432Node\\SketchUpXX\\SketchUp 2014\\InstallLocation\\") rescue WIN32OLERuntimeError val = "" end#begin/rescue if (val == "") begin val = wsh.RegRead("HKLM\\Software\\SketchUpXX\\SketchUp 2014\\InstallLocation\\") rescue WIN32OLERuntimeError val = "" end#begin/rescue end#if wsh.ole_free puts "VAL; " + val
  • Name of texture

    6
    0 Szavazatok
    6 Hozzászólások
    574 Megtekintések
    G
    Thank you, TIG ! it works.
  • Set_position for modal dialog

    6
    0 Szavazatok
    6 Hozzászólások
    663 Megtekintések
    tt_suT
    I know that under OSX there are issues if you use the body.load event to modify the webdialog. It appear white until you click in the window - but I've not seen that under Windows. For the OSX issue the solution is to use the event that trigger when the DOM is ready. All though, I use jQuery to take care of cross-compatibility issues.
  • Functions in 'require' are not updated till restart..

    4
    0 Szavazatok
    4 Hozzászólások
    385 Megtekintések
    Dan RathbunD
    You should NOT be including ANY module like Math into the global objectspace, which is actually class Object. Everyone else's classes and modules will then inherit any change YOU make to the global objectspace! It does not matter whether you will be distributing or not. There is a right way to code. It is more about not corrupting other people's plugins. There is NO reason whatever for you to run code outside YOUR OWN module namespace. So pick a unique toplevel module name, like Guida or RG or whatever, and then define ALL your plugins as sub-modules of YOUR toplevel modulespace. Within each plugin module, define nested modules and / or classes, as needed by each plugin.
  • Building C extension compatibility

    13
    0 Szavazatok
    13 Hozzászólások
    1k Megtekintések
    tt_suT
    @anton_s said: [*]Modify LongDouble.c in ffi: Replace RSTRING_PTR(s) with (RSTRING(s)->ptr) in line Easier and more maintainable to add the macros if they are undefined: https://bitbucket.org/thomthom/tt-library-2/src/be17bac137aa5421323733cc206d80b9ff885dc4/Ruby%20C%20Extensions/win32-api/ext/tt_api.c?at=Version%202.9#cl-5
  • Retrieve the size of bounding box of selection

    23
    0 Szavazatok
    23 Hozzászólások
    4k Megtekintések
    M
    Nice all this but, i am new in ruby, how can i retrieve the size of all component... including sub-component? ` mod = Sketchup.active_model # Open model ent = mod.active_entities # All entities in model message = "" ent.each { |e| n = e.name scale_x = ((Geom::Vector3d.new 1,0,0).transform! e.transformation).length scale_y = ((Geom::Vector3d.new 0,1,0).transform! e.transformation).length scale_z = ((Geom::Vector3d.new 0,0,1).transform! e.transformation).length bb = nil if e.is_a? Sketchup::Group bb = Geom::BoundingBox.new e.entities.each {|en| bb.add(en.bounds) } elsif e.is_a? Sketchup::ComponentInstance bb = e.definition.bounds end if bb dims = [ width = bb.depth * scale_x, height = bb.width * scale_y, depth = bb.height * scale_z ] message = message + "Cabinet: " + n + "\nHeight: #{dims[0].to_l}\tWidth: #{dims[1].to_l}\tDepth: #{dims[2].to_l}" end } UI.messagebox(message, MB_MULTILINE)` I would like to have dimensions of all pieces of the cabinet. I know Cutlist. But i only need name of piece and dimensions. And Cutlist script is to complicated for me. Someone can help me with this? PLZ
  • Round corners and CSS3

    15
    0 Szavazatok
    15 Hozzászólások
    3k Megtekintések
    L
    More about CSS round corners....http://www.corelangs.com/css/box/round.html lynda
  • Selection !

    2
    0 Szavazatok
    2 Hozzászólások
    355 Megtekintések
    A
    The simplest way is to allow the user to select any entities. Just care only about those selected entities that are edges: edges = Sketchup.active_model.selection.grep(Sketchup::Edge) Let's say you now need to be sure there is a minimum of edges: return UI.messagebox("You need to select two or more edges.") if edges.length < 2 The cleanest way would be to implement your own tool class for selecting entities. You would use a PickHelper to get whatever is below the point that the user clicked, and only if it is an edge you would add it to an array or selection (actually you do not really need to add it to the real selection), and then draw/highlight what is selected. Don't do this until you have enough experience. If something does not work, please give complete (and minimal!) examples and say what does not work. All I could say about Sketchup.active_model.selection.each is that it raises an error because it is an iterator method with missing block ("each" is not "edge").
  • Observer interface (best practices?)

    9
    0 Szavazatok
    9 Hozzászólások
    1k Megtekintések
    A
    Hmm, thats a good example. Now, I won't have to use variables to tranfer data between two different class instances. Simply having 'em all in one class is good implementation. This is how I think Sketchup Observers work. <span class="syntaxdefault"><br />class Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Selection<br /><br />  def initialize<br />    </span><span class="syntaxkeyword">@</span><span class="syntaxdefault">observers </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">[]<br /></span><span class="syntaxdefault">  end<br /><br />  def add_observer</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">obj</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">    </span><span class="syntaxkeyword">@</span><span class="syntaxdefault">observers </span><span class="syntaxkeyword"><<</span><span class="syntaxdefault"> obj<br />    true<br />  end<br /><br />  def remove_observer</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">obj</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">    </span><span class="syntaxkeyword">@</span><span class="syntaxdefault">observers</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">delete</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">obj</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">?</span><span class="syntaxdefault"> true </span><span class="syntaxkeyword">;</span><span class="syntaxdefault"> false<br />  end<br /><br />  </span><span class="syntaxcomment"># Some method triggered by SketchUp private API.<br /></span><span class="syntaxdefault">  def _trigger_selection_added</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">sel</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> element</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">    </span><span class="syntaxkeyword">@</span><span class="syntaxdefault">observers</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">each </span><span class="syntaxkeyword">{</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">|</span><span class="syntaxdefault">obj</span><span class="syntaxkeyword">|<br /></span><span class="syntaxdefault">      next unless obj</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">respond_to</span><span class="syntaxkeyword">?(;</span><span class="syntaxdefault">onSelectionAdded</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">      begin<br />        </span><span class="syntaxkeyword">@</span><span class="syntaxdefault">obj</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">onSelectionAdded</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">sel</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> element</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">      rescue Exception </span><span class="syntaxkeyword">=></span><span class="syntaxdefault"> e<br />        puts </span><span class="syntaxstring">"#{e}\n#{e.backtrace.first}"<br /></span><span class="syntaxdefault">      end<br />    </span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault">  end<br /><br />  </span><span class="syntaxcomment"># ...<br /></span><span class="syntaxdefault">end<br /></span> I think the event is called only if the tool contains that method. This might tell us that you tool isn't event supposed to be an instance. It may be a module as well. As long as the methods are accessible ( self.onSelectionAdded) your good to go.
  • A small "entity to group" problem

    4
    0 Szavazatok
    4 Hozzászólások
    546 Megtekintések
    Dan RathbunD
    @artmusicstudio said: ..., is there a code for deliting an array of edges directly ? or do i have to iterate thru the array and erase one after another? use Entities.erase_entities() The argument can be a single entity, or an array of entities. ALSO... Ruby has an "accordian operator" the * that can be used to expand an array into a argument list, or compress arguments in an array. IF erase_entities also takes a list of multiple entities, you could convert the aray to a list like: my_ents.erase_entities( *my_edge_array )

Advertisement