ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • Sketchup.find_support_file

    12
    0 Votes
    12 Posts
    1k Views
    Dan RathbunD
    Actually Martin.. that example was quick and dirty. It CAN be cleaned up. I was thinking it would be better to break out of the iteration when the proper match was found, rather then keep iterating, though how many paths do most people have in their $: anyway? You'd likely run a method and set a constant (perhaps Integer index into $LOAD_PATH) and then use that reference from then onward. So it should be a one time, startup type thangy... One thing I do is actually put set ENV['SUpath']
  • Set path for request dlls

    3
    0 Votes
    3 Posts
    189 Views
    Dan RathbunD
    Most people (who run Su on PC,) already have a copy of Win32API.so where their $LOAD_PATH array can find it, so you should only need to: require 'Win32API' if it's already loaded, require will skip reloading it. You can even get more fancy, by first checking if it's loaded, because it defines the class Win32API, and classnames are constants ie: unless (defined? Win32API)=='constant' %(#F0F0F0)[__]require 'Win32API' end Also.. I think you must unload those DLLs when your plugin is done with them. Perhaps you might need to use a custom AppObserver implementing the onQuit callback, with your plugin.
  • Switch direction of edge?

    7
    0 Votes
    7 Posts
    327 Views
    C
    TIG's method of getting the vertices of a face worked for me. Thanks everyone for the replies.
  • Sketchup use of WebKit

    3
    0 Votes
    3 Posts
    589 Views
    W
    When Sketchup is run there is no instance of Safari that shows up in the process list. Actually, nothing shows up in the process list other than Sketchup. This indicates that all of the processing is managed within Sketchup itself. Therefore, the sketchup application is linking to frameworks to get its services - rather than launching separate applications. The web framework that Sketchup uses is WebKit. Within the Sketchup bundle there is a WebDialog.framework The WebDialog.framework has the WebKit.h file so I'm assuming it links to the WebKit.framework within the OS I have loaded the nightly build for WebKit and redirected the load path to use the new build. If Sketchup is calling WebKit.framework it should be the one I'm referencing. Its possible that Sketchup is using some kind of "statically linked" instance of webkit but that isn't likely (I hope) The nightly build has a built in Javascript Debugger within the WebInspector but now I need to figure out how to activate it since the Sketchup WebDialogs don't respond to a context click (a right click) like normal Safari windows. I hope I'm on the right track since a JavaScript debugger would be a great help to WebDialog development!
  • Pushpull scripting. need HELP plz

    7
    0 Votes
    7 Posts
    306 Views
    Chris FullmerC
    OK, just got Sketchup and the web console installed on my system so I could test this out. Sure enough, making TIG's changes, plus the ones I showed above, and it all works. This is the final code: model = Sketchup.active_model sel = model.selection model.start_operation "mult. pushpull" faces = [] sel.each do |e| faces << e if e.is_a? Sketchup;;Face end faces.each do |face| face.pushpull 100 end model.commit_operation There you go! Let me know how the other tutorials go also!, Chris
  • Breaking an ArcCurve - how?

    2
    0 Votes
    2 Posts
    128 Views
    thomthomT
    Yes Thomas - you blind pillock - it's under the Edge class. Edge.explode_curve http://code.google.com/apis/sketchup/docs/ourdoc/edge.html#explode_curve
  • [Web dialog] switch snippet for pc / mac

    7
    0 Votes
    7 Posts
    310 Views
    chrisglasierC
    To make or to become weary; A feeling of being mentally fatigued; Expressive of fatigue Wary: marked by keen caution and watchful prudence; Either I think is appropriate. But more important cgScenes might well become compatible - some kind of milestone in PC/Mac WD compatibility perhaps.
  • Any way through ruby to create a component collection

    4
    0 Votes
    4 Posts
    211 Views
    chrisglasierC
    And, John, I think you said you have Macified cgScenes. I wonder if that version also works on PCs. Or do you think it should released as a Mac version? Oh and also you should note that cgScene start button was introduced because Macs run the script before loading the model. However nset doesn't rely on model data at the start but it is something you might like to add to the "no js after window.location" for callbacks I pointed to before.
  • Separating a plugin from others

    22
    0 Votes
    22 Posts
    1k Views
    tbdT
    FILE when ruby is scrambled is useless as it gets evaled, so you cannot use it. had the same problem when developing/using Sketchup Bridge. workaround: add the path to the global search path for loading scripts $:
  • Toogle Dialogs via Ruby?

    5
    0 Votes
    5 Posts
    629 Views
    Dan RathbunD
    @thomthom said: Ok - that's toggle. aka (Menu) Windows > Show / Hide Dialogs @thomthom said: ... And is there any way to know if they are hidden or not? You CAN get whether the USER has each one set to be shown or hidden thru the registry. Ex: Sketchup.read_default('SnappyComponents','show',0)==1 ? true : false and also whether it's RolledUp or not Sketchup.read_default('SnappyComponents','Minimized',0)==1 ? true : false EDIT: Nevermind read_default (doesn't work) use the standard Ruby Registry module. Seems Sketchup.read_default cannot handle (or does not return by design,) DWord values in the Registry. EDIT2: Fixed: the 'show' attributes are all downcase. IF attribute 'Show' is 0, the dialog is hidden no matter what the (global) "Show/Hide Dialogs" toggle setting is. IF the dialog is 'rolled-up', AND shown (on screen) it's 'Minimized' attribute is 1 AND 'show' is 1. When you close the 'Minimized' dialog, it's attributes are 'Minimized'=1 and 'show'=0. When a closed 'Minimized' dialog is re-shown (Same session, or new session,) the 'Minimized' attribute is changed to 0 because Sketchup auto-unrolls it, and the 'show' attribute = 1. But I cannot find a way to know (cross-platform) whether the (Show/Hide Dialogs) Menu item is checked or not. Of course we can do it using Win32API call. When the dialogs are globally Hidden their 'Show' registry attributes remain unchanged, and the Show/Hide toggle is reset (all dialogs are shown per registry settings,) when you reopen Sketchup.
  • Trouble triggering javascript event from sketchup

    14
    0 Votes
    14 Posts
    685 Views
    thomthomT
    @unknownuser said: button.attachEvent. Yes -that jogged my memory - attachEvent was the IE way. (imagined that later IE (IE7 or IE8) used addEventListener as it's part of the DOM standard. But maybe I was wrong. ...or maybe it depends on the doctype....
  • C != C

    18
    0 Votes
    18 Posts
    716 Views
    M
    @agamemnus said: With the recent Google Chrome's and Firefox's very fast Canvas (graphics) rendering, JS has become even more useful. I second that emotion! <canvas> is great. It's just about the most fun you can have in 2D.
  • Pianola demo

    3
    0 Votes
    3 Posts
    332 Views
    chrisglasierC
    And ... it can be quick and easy to edit/customise in an open source environment. ... it could have audio commentary. Wikipedia
  • Help and contribution needed. Thank you.

    3
    0 Votes
    3 Posts
    160 Views
    M
    Do you have the dialog sketched? Is there a fixed dialog or does it vary depending on the model? An HTML form would go a long way here.
  • Cloud_V6 query

    13
    0 Votes
    13 Posts
    1k Views
    TIGT
    Only certain 'raw' file types are allowed to be uploaded here: a .csv file needs re-sufixing or zipping... I tested the file and it worked fine for me - imported cloud and made a surface [v7 + PC] - so... do you have the latest version and its pdf help file ? http://www.crai.archi.fr/RubylibraryDepot/Ruby/em_fil_page.htm get the Cloud_v6,zip file...
  • Re-use progress bar that Dynamic Components use

    5
    0 Votes
    5 Posts
    206 Views
    T
    You can send out progressbar with your code, but tell your clients where you got it and to come to us for support. Todd
  • Is there any vertex editing plugin?

    27
    0 Votes
    27 Posts
    2k Views
    mitcorbM
    ThomThom: As you know, some of the Sketchup tools and plugins will create quads, such as pushpull, follow me, lines to tubes. The results seem more refined, less chaotic to me. Blender has a built in tool to reduce triangles to quads, for instance, because apparently, that program prefers it. But I guess it's all about file size economics.
  • Ruby :symbols

    3
    0 Votes
    3 Posts
    147 Views
    M
    @thomthom said: What is off target and plain wrong? A question I can't answer until I can answer my own question: What's a symbol? The link was a good one but after a too-quick read I was better versed in what you could do with symbols that what a symbol was. In most languages there is a symbol table, under the covers. Ruby symbols seem to be bringing this capability forward, allowing us to add to the table in some way that I'm not sure I understand. Edit: make that "in some way I'm sure I don't understand." end edit Nagging questions: if "foo" is a variable name it will be in the symbol table and :foo will be a symbol. What about "foo.bar"? Is that a :foo plus a :bar, or is it :foo.bar?
  • By value or by reference?

    20
    0 Votes
    20 Posts
    2k Views
    Dan RathbunD
    @thomthom said: @unknownuser said: see also The Ruby programming language By David Flanagan, Yukihiro Matsumoto Interesting link. I think I need to read further into that book. No Kidding! Yukihiro Matsumoto is "Matz" the inventor of Ruby! I didn't know Google Books had this.
  • Sketchup registry key ?

    27
    0 Votes
    27 Posts
    13k Views
    Dan RathbunD
    @jim said: Does there exist some sort of .zip installer? As I recall, WinZip could create self-extracing archives (.exe extension,) with a 'suggested destination folder'. When run, a confirm dialog popus up, allowing the user to override with a browse button, or simply edit the destination path in the edit control box. Still in use today, but I believe is a pay WinZip Pro version that only will do this. Cabinet files (.CAB) are free and native to Windows, I believe at least the extract exe is installed on all Win32 machines; the cab maker (filename slips my mind,) is in the SupportTools package. BTW, MSIs use cab by default I believe.

Advertisement