ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • Issues with Scrambler

    6
    0 Votes
    6 Posts
    1k Views
    Dan RathbunD
    Karen.. this is a forehead smacker (so get your hand ready.) Standard Ruby has no idea what a scrambled rbs file is, or how to decrypt it. So the SU development team created a module method that could open, decrypt and then evaluate them. You need to use the Sketchup::require() module method. There are other issues with scrambling. The Ruby keywords __LINE__ and __FILE__ do not currently work inside scrambled rubies. (Fixed in SketchUp 2014+ using Ruby 2.0 or higher.) I'm am glad that you have decided to use your own filespace. It's only smart. I posted an example of doing this with scrambled rubies. See: [ code ] SketchupExtension and rbs rubies
  • Webdlg debugging on Mac using WebKit inspector

    8
    0 Votes
    8 Posts
    1k Views
    tt_suT
    Install Visual Studio Express (free). Then you can either attach it to SketchUp's process, or inject debugger; statement in your JS code to make the system prompt you to debug. You can then set breakpoints in Visual Studio and inspect variables and call stacks. I sometimes use a catch-all code like this to trigger the debugger on errors without having to inject debugger; around in the code: window.onerror = function(message, location, linenumber, error) { // Trigger an request to attach debugger. debugger; return false; };
  • HTML5 Canvas in Webdialogs

    3
    0 Votes
    3 Posts
    391 Views
    B
    Brilliant! Thank you so much - it's working fine now.
  • Unexpected result (closest_points)

    3
    0 Votes
    3 Posts
    242 Views
    D
    sorry for my silly mistake, thanks Sdmitch
  • Selection.add ??? possible?

    4
    0 Votes
    4 Posts
    291 Views
    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 Votes
    4 Posts
    624 Views
    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 Votes
    12 Posts
    761 Views
    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 Votes
    4 Posts
    450 Views
    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 Votes
    20 Posts
    1k Views
    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 Votes
    14 Posts
    1k Views
    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 Votes
    4 Posts
    656 Views
    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 Votes
    3 Posts
    247 Views
    R
    Hej Thom, Then it sounds like I have to switch to Sketchup 2014
  • Retrievin object's absolute height ??

    18
    0 Votes
    18 Posts
    694 Views
    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 Votes
    7 Posts
    295 Views
    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 Votes
    8 Posts
    872 Views
    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 Votes
    6 Posts
    281 Views
    G
    Thank you, TIG ! it works.
  • Set_position for modal dialog

    6
    0 Votes
    6 Posts
    429 Views
    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 Votes
    4 Posts
    219 Views
    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 Votes
    13 Posts
    748 Views
    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 Votes
    23 Posts
    3k Views
    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

Advertisement