⚠️ Update | Sketchucation Tools 5.0.8 released with licensing improvements and bugfixes Download

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
  • What version of Ruby should I start learning?

    20
    0 Votes
    20 Posts
    2k Views
    N
    Thanks a lot!
  • Open External Links With Default Browser

    4
    0 Votes
    4 Posts
    466 Views
    A
    Here is the code snippets, just so if anyone is interested later This goes to JavaScript: <span class="syntaxdefault"><br /></span><span class="syntaxcomment">// Determines whether string contains another string.<br /></span><span class="syntaxdefault">String</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">prototype</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">contains </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> function</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">it</span><span class="syntaxkeyword">){<br /></span><span class="syntaxdefault">    return this</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">indexOf</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">it</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">!=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">-</span><span class="syntaxdefault">1</span><span class="syntaxkeyword">;<br />};<br /><br /></span><span class="syntaxcomment">// Calls a Ruby callback.<br /></span><span class="syntaxdefault">function callback</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">name</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> data</span><span class="syntaxkeyword">){<br /></span><span class="syntaxdefault">    if </span><span class="syntaxkeyword">(!</span><span class="syntaxdefault">data</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> data </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxstring">''</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">    window</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">location</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">href </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxstring">'skp;'</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">+</span><span class="syntaxdefault"> name </span><span class="syntaxkeyword">+</span><span class="syntaxdefault"> </span><span class="syntaxstring">'@'</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">+</span><span class="syntaxdefault"> data</span><span class="syntaxkeyword">;<br />}<br /><br /></span><span class="syntaxcomment">// Open links with default browser.<br /></span><span class="syntaxkeyword">$(</span><span class="syntaxdefault">document</span><span class="syntaxkeyword">).</span><span class="syntaxdefault">on</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'click'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">'a[href]'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> function</span><span class="syntaxkeyword">(){<br /></span><span class="syntaxdefault">    if </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">this</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">href</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">contains</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"http"</span><span class="syntaxkeyword">)){<br /></span><span class="syntaxdefault">        callback</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'open_link'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> this</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">href</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">        return false</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">    </span><span class="syntaxkeyword">}<br />});<br />&nbsp;</span><span class="syntaxdefault"></span> This goes to Ruby: <span class="syntaxdefault"><br /></span><span class="syntaxkeyword">@</span><span class="syntaxdefault">dlg</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_action_callback</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'open_link'</span><span class="syntaxkeyword">){</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">|</span><span class="syntaxdefault">dlg</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> params</span><span class="syntaxkeyword">|<br /></span><span class="syntaxdefault">  UI</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">openURL</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">params</span><span class="syntaxkeyword">)<br />}<br />&nbsp;</span><span class="syntaxdefault"></span>
  • How do you intersect two faces?

    5
    0 Votes
    5 Posts
    946 Views
    C
    Thanks for the replies! slbaumgartner, splendid advice. It worked much smoother than I thought it would. The code is attached below. Here are some results from intersecting the two columns in the example file: Intersect from UI: 983s Outer shell (*****): 161s g0.intersect_with g1 (******): 104s Intersect face pairs: 4s () Outer shell is probably dominated by the intersect (*) In order to produce all edges for coplanar cuts two calls to intersect_with has to be made with the groups reversed. The result above is for a single call. cuttest.zip CAUL_CutTest0.3.rb
  • Create component with different axes

    13
    0 Votes
    13 Posts
    911 Views
    JQLJ
    @garry k said: JQL Flip along axis is great however, if the component has an interaction like rotate to simulate a door opening then you will find that the component reverts back to it's original state (you loose the flip). What I need to do is change axes. Funny doesn't happen to me. But I don't question your need to change axis.
  • Read Serial port or USB interface

    11
    0 Votes
    11 Posts
    3k Views
    S
    Hi! I am a student of electrotechnical engineering and i'm doing a project. I need a little help! How i get values from serial port to sketchyphysics?
  • Pick material under cursor

    3
    0 Votes
    3 Posts
    411 Views
    Dan RathbunD
    FYI, at the console: ts = Sketchup.active_model.tools %(#004000)[#<Sketchup::Tools:0x999fd98>] ts.active_tool_name %(#004000)[PaintMatchTool] ts.active_tool_id %(#004000)[21255] On the PC using the tool id does not seem to work (whilst it does for other native tools): Sketchup.send_action( 21255 ) .. nor does a action string: Sketchup.send_action "selectPaintMatchTool:" ?
  • UI doesn't update

    6
    0 Votes
    6 Posts
    589 Views
    nikusknxN
    Update for Sketchup 2014 : require "Win32API.rb msg = "\000" * 36 peekMessage = Win32API.new('user32','PeekMessage' , 'PLIII', 'I') peekMessage.call( msg, 0, 0, 0, 0x0000 ) != 0
  • A way to avoid that ?

    29
    0 Votes
    29 Posts
    14k Views
    nikusknxN
    Update for Sketchup 2014 : require "Win32API.rb msg = "\000" * 36 peekMessage = Win32API.new('user32','PeekMessage' , 'PLIII', 'I') peekMessage.call( msg, 0, 0, 0, 0x0000 ) != 0
  • Custom importer - setting options

    11
    0 Votes
    11 Posts
    951 Views
    T
    @tt_su said: Sorry about the delay in response. The API is currently missing the ability to set import options. I ensured we had a feature request for it filed. I forgot to say thankyou for this. Hope it gets sorted out.
  • Sketchup.load

    11
    0 Votes
    11 Posts
    850 Views
    Al HartA
    @tt_su said: Yea, it's an annoying deviance that Sketchup::load acts like Sketchup::require. For my personal projects I got reload code for when testing RBS files where I remove the file from the $LOADED_FEATURES list. $LOADED_FEATURES - Aha! I didn't know about that. I guess you learn something ever day.
  • Problem with the boundary of the viewport and my tool

    4
    0 Votes
    4 Posts
    482 Views
    jolranJ
    Same here on SU8. On both sides of the window. If I hold down the mousebutton near border of window(at the right side where there's no tools)and do a mousemove/nudge it starts panning right sometimes.
  • How to properly handle escape characters?

    4
    0 Votes
    4 Posts
    556 Views
    tt_suT
    @anton_s said: Actually a hidden input does not allow multi lines. I used textarea with display:none; style instead. From my current observations the technique works amazing! Oh! ... ooh... I might have to revisit SKUI and check this.
  • Create text in the viewport

    7
    0 Votes
    7 Posts
    681 Views
    tt_suT
    Yea, it's a known - annoying - limitation with draw_text. Both color and size would be good to have.
  • [Sketchup C API]Howto merge models oftwo .skp files into one

    5
    0 Votes
    5 Posts
    973 Views
    tt_suT
    I'll check with the rest of the team on the unit issue.
  • How do I get Mathn.rb to work?

    15
    0 Votes
    15 Posts
    1k Views
    tt_suT
    @ellipser said: I'd like to learn how to interface C++ with Sketchup, so I can speed things up. Basically my problem is that I need a road-map of sorts to get there. First thing is, what C++ compiler should I use? Visual Studio? I don't want to pay Bill Gates $500 for just hobbyist work that I'm doing. I used DevC++ before. I'm not at all familiar with Xcode, so I guess I'll Google that after I'm done writing this post. https://github.com/SketchUp/ruby-c-extension-examples That git repo includes Visual Studio and Xcode project examples for an Hello World extension - including the Ruby libs and headers we use. @ellipser said: I've seen the SDK code on the Trimble site, but, what next? Step 1 would be of course to download a C++ compiler. Then what? Where do I put all the header files? Could you recommend a tutorial if there is one? The C SDK is for reading and writing SKP files -not for acting on the live model. @ellipser said: Ultimately, I'm going to interface Sketchup with my 3D printer, which is in the final stages of being made. (It already does plotting when provided G-code). Next step is mounting the extrusion head and generating G-code from a Sketchup file. Also, with just using the Dremel mount I have, I can do milling. I want to do some Celtic designs created in Sketchup and then milled into wood. Nice! Got a project blog?
  • Width problems with select option in WebDialog

    23
    0 Votes
    23 Posts
    2k Views
    tt_suT
    @maricanis said: Frankly, no experience and knowledge about document modes, I've just used the default ones till now. Any suggested readings on this? Especially related to embedded vs. browser mode? I always make sure I use strict mode (full standard mode) and that mode renders best across different browsers and is the way forward. Everything else, quicks mode, is just legacy war damage from the ancient browser battles .
  • [Talk] Ruby Debugger for SketchUp 14+

    45
    0 Votes
    45 Posts
    10k Views
    T
    @avariant said: When displaying data about a variable, does it volunteer variable names or does it just respond with a value? I would be very disappointed to find out it did The debugger is exposing nothing new here, the same thing could be done anyway through any of the SU consoles by any savvy Rubyist - using nothing but standard Kernel method calls. Setting trace functions and using the returned bindings to read local and instance variables, get the current method and its call signature, read the call stack etc... can all be done from even the most basic install of Ruby. You can't actually read the code lines unless they are in a 'plain text' source file (the scrambler presumably 'evals' the unscrambled code, which precludes seeing the source) - but there's not much that can be done to secure the other information without losing the consoles - which would make life very difficult for the amateur developers that we all rely on for our toys!
  • Scene (Page) animation of Section Cuts

    10
    0 Votes
    10 Posts
    939 Views
    TIGT
    You can 'get' & 'set' [with = ] page.name BUT you can only 'get' the page.label By default the page.name==page.label and so it's in the animated set... Sorry, but the API is lacking page.label= or similar... Of course, the Animation class can be used filtering out () labels, BUT you can't change a page.label in code
  • Translations for plugins?

    14
    0 Votes
    14 Posts
    1k Views
    Dan RathbunD
    @aerilius said: Each plugin would be translated individually, with based on .strings files as you already have, but hosted online (like you can host code in git/mercurial/bazar). I'm out. I do not use .strings files, nor LanguageHandler specifically because it's fixes are not backported. (And they never will be, because backporting is against the SketchUp Dev Team's religion.)
  • Git for SketchUcation?

    23
    0 Votes
    23 Posts
    2k Views
    Rich O BrienR
    The bug reporting is being worked on. We just need to figure out some of the details before testing. It will be a process through which you (the dev) will see the bug submissions on the dashboard and the members can flag posts as bugs on the forums. Unflagging will also be possible. Users can also flag a bug through the plugin and submit some text. We need some method where the dev doesn't need to read 3 pages of posts just to find that one post that has a bug. @andreas the ratings system was an experiment on our side. we needed to see how proactive users were with microtransactions. there's a very good chance we will retire it to the site only for v3.0 of the pluginstore. @all we are definitely listening to all the suggestions here. if there's things you want to happen let us know as we entering into knuckle down time soon. if you want to play an active roll in v3.0 let us know.

Advertisement