ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • Get component definition name

    3
    0 Votes
    3 Posts
    349 Views
    alexandre skA
    ohhhhhh this one is for me: [image: dumbass.jpg] Thank you very much. I was expecting something very simple but not that simple. Starting to like ruby. I only know php and javascript, but this ruby is good. Thank you Jim
  • Find vertex resulting from a pushpull or transformation

    8
    0 Votes
    8 Posts
    388 Views
    Dan RathbunD
    The wrapper method in "sketchup.rb" is in need of an overhaul. Post your suggestions in thread: [Code] better inputbox() wrapper
  • Reading registry values withouts quotes

    2
    0 Votes
    2 Posts
    241 Views
    Dan RathbunD
    What Windows version and SketchUp version ? EDIT. Nevermind, just go to this post from last Thursday, 1st of May: Re: get registry string from ruby 2.0 (Also works with older versions, if user has the old "win32ole.so" file downloaded from the Plugins forum [link shown.])
  • Nicedit for SketchUp (javascript issue)

    9
    0 Votes
    9 Posts
    1k Views
    inteloideI
    Hello, thank you for your answer. Actually the main reason why it didn't work, is beceause jQuery was required. Once added, it work fine. Inteloide
  • Tool: rak - like grep only optimized for source code repos

    2
    0 Votes
    2 Posts
    299 Views
    tt_suT
    Nice! Thanks for the link!
  • Web dialogs stealing focus within my tool.

    28
    0 Votes
    28 Posts
    2k Views
    Dan RathbunD
    Dang it! That is news to me. Did ya'll hire someone to to be a TechWriter for the API? (Ya' need to badly.)
  • Push_tool

    5
    0 Votes
    5 Posts
    265 Views
    A
    Thanks guys. Yes, I was doing a pickhelper or ray intersection and figuring out the object being clicked on and added it to the global selection. That worked fine, but only allowed selecting one entity at a time. I wanted to switch to select tool so I can use the group selection features that are available in it. Like thomthom suggested, I managed to get that working by backing up the current tool before doing Sketchup.send_action("selectSelectionTool:") and then restoring the older tool on release. This probably won't retain the tool state since I'm actually exiting the tool and re-entering, but it seems to work for my purpose. Thanks again!
  • OnKeyDown: getting the charcater value from key

    32
    0 Votes
    32 Posts
    2k Views
    Dan RathbunD
    Yea did you look at the C code by clicking the method in the CHM ? It has a kind of convoluted switch statement.
  • Plugin publishing questions.

    7
    0 Votes
    7 Posts
    302 Views
    G
    Sounds good. The draw step can be reversed or stopped by deleting the group the draw is writing to, but I don't have it enclosed in an operation. I can add that in. That's the only thing that really needs to be undone; I'm not really crazy about a single undo step rewriting the CNC environment variables and outputting the gcode to a file is a single step anyway that can't be reversed short of deleting the files from the filesystem.
  • Overwritten script!!!

    5
    0 Votes
    5 Posts
    275 Views
    D
    did you type it directly into 'Ruby Console' and is the session still open? if so, you can use the 'up arrow' to go back to it, otherwise it's a learning experience... EDIT: should have read the post in detail first, but I'll leave this up for others... if your on linux what editor did you write it in, most have history... john
  • Create file with accent in the path

    23
    0 Votes
    23 Posts
    934 Views
    Dan RathbunD
    @tt_su said: @dan rathbun said: fail() #re-raise the last exception Never seen that method used before. Is that different from just calling raise? raise() is an alias for fail() See the doc on the Kernel module: http://www.ruby-doc.org/core-1.8.6/Kernel.html#method-i-fail The best practices guides I have read, suggest that fail be used instead of raise, for readability, I suppose. But I really did not understand the logic in the guide. (I think it was something like "raise" has more meanings as a verb than "fail" ?)
  • Is there a <select equivalent for <input onClick?

    7
    0 Votes
    7 Posts
    588 Views
    sdmitchS
    Thanks much Dan for the info. Looking back at by previous posts, I see that I never made it clear that the question is relative to a WebDialog associated with a plugin. Don't know if that matters but just so you know. Eureka I have found it. It was all a matter of where the onChange was. Because the onClick was part of each radio button statement, I assumed it was the same with the select list. Instead it just needed to be in the <select> statement itself. Thanks again to one and all for the links that put me on the right path to find the answer. def showme() @dlg=UI;;WebDialog.new("VerySimple", true,"Test",500,300,10,10,true) @dlg.set_html( "<html> <body> <form> <select onChange='tellSketchup(value)'> <option value='option1' >Option 1</option> <option value='option2' >Option 2</option> </select> ; Head Type<br><br> </form> <script type='text/javascript'> function tellSketchup(value) { window.location='skp;OptionChanged@'+value; } </script> </body> </html>" ) @dlg.show {} #show it @dlg.add_action_callback("OptionChanged") {|d,p| puts "OptionChanged value=#{p}" } end
  • Minimize WebDialog from code?

    5
    0 Votes
    5 Posts
    296 Views
    D
    maybe I'm missing the point... @dlg.set_size(100,100) @dlg.set_position(100,100) @dlg.set_size(1000,1000) @dlg.set_position(100,100) can switch between 2 sizes at the same position... john
  • EntitiesObserver Weirdness

    3
    0 Votes
    3 Posts
    224 Views
    K
    Hi Dan, Holding a reference does't make any difference. The only time the reference held by @m is actually stored is when the observer is assigned to Sketchup.active_model.entities. Also, I noticed that in cases where I have a new file, and I first add the observer to a group's entities collection, the observer does not alert onElementModified for the material. It only alerts for the face. Thanks, -- Karen
  • Trying to Display a Help File (Help.jpg)

    6
    0 Votes
    6 Posts
    289 Views
    K
    This is what finally worked: def dowelHelp dowel_help_File = File.join(File.dirname(__FILE__),"K2_ToolsSupportFiles","k2ws_DowelHelp.html") UI.openURL("file;///#{dowel_help_File}") UI.messagebox("Dowel Help Complete " + dowel_help_File.to_s) end #def dowelHelp The html file was: <!DOCTYPE html> <html> <body> <p> <img src="K2_ToolsDowelHelp.png" > </p> </body> </html> Thanks Keith
  • 3D_text color

    4
    0 Votes
    4 Posts
    265 Views
    J
    Jim/Dan, Thanks for the reply. Adding material (and back_material) to grp works for me. Understanding why this happens is even better.
  • [Code] PCFileTools

    27
    0 Votes
    27 Posts
    4k Views
    Dan RathbunD
    BUMP
  • EntitiesObserver in SU 2014

    4
    0 Votes
    4 Posts
    317 Views
    Dan RathbunD
    @kwalkerman said: Is there any other way to detect new objects in a model ... groups and component instances? Try the DefinitionObserver # onComponentInstanceAdded callback.
  • Help me solve a mystery

    11
    0 Votes
    11 Posts
    526 Views
    D
    Is this editor will have the same behavior? http://www.alexschreyer.net/projects/sketchup-ruby-code-editor/ the author said it was based on the Ruby Web Console
  • Own Plugins in 2014

    5
    0 Votes
    5 Posts
    285 Views
    F
    ok, my mistake i saved some values by write_default, at the start the plugin get them by read_default and in these values i had some non-utf-characters i changed the values and now it works like before Frank

Advertisement