ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • Webdialog to ruby encoding issue on OSX

    22
    0 Votes
    22 Posts
    730 Views
    D
    @tt_su said: So this only happen on OSX, not on Windows? hi TT did you get a chance to run this on your mac? and did it confirm what I state, on your setup? john
  • Newbie question: extrude following a straight line in space

    8
    0 Votes
    8 Posts
    359 Views
    M
    Ah! ok, then I understand it. Thanks again!
  • Project Tango

    3
    0 Votes
    3 Posts
    245 Views
    olisheaO
    maybe google are concurrently working on a 3D app too?
  • Method to Explode Groups by name beginning...

    3
    0 Votes
    3 Posts
    179 Views
    S
    Looks like you focused only on group class, and corrected the wall name syntax, and I am very grateful as it now works! Thanks Tig
  • What version of Ruby should I start learning?

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

    4
    0 Votes
    4 Posts
    282 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
    620 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
    376 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
    199 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
    288 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
    12k 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
    489 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
    298 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
    272 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
    312 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
    367 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
    657 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
    716 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
    605 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 .

Advertisement