sketchucation logo sketchucation
    • Login
    1. Home
    2. Dan Rathbun
    3. Posts
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
    Offline
    • Profile
    • Following 0
    • Followers 1
    • Topics 92
    • Posts 4,904
    • Groups 2

    Posts

    Recent Best Controversial
    • RE: Open URL on local disk

      @martinrinehart said:

      It opened the HTML, but it opened it in Notepad++.

      This a problem specific to your machine Martin, because you have overridden the HTML &Open file association to open in Notepad++ instead of leaving it pointing to your default browser (IExpore).

      You should have instead had the &Edit association pointing to Notepad++, and left the &Open as it was.

      So it is not a problem for your users... it's personal problem. 🀣

      To 'fix' it, open Windows Explorer, any folder (doesn't matter.)

      • On Menu: Tools > Folder Options...* In "Folder Options" dialog, choose "File Types" tab.* [Windows will take a few mins to build the list]* In list, (with 1st item selected,) click the "H" key to scroll down to the H extensions.* scroll a bit more to show HTM and HTML extensions* highlight each in turn, click the "Advanced" button* In "Edit File Type" dialog, highlight "Open"* If it's NOT set to default, the "Set Default" button will be enabled, so click it to restore normal htm/html broswer open.* If it's set to default, the "Set Default" button will be greyed (disabled,) and it's properly set.I'm not sure if you will need to log off, and back on to see changes reflected.
      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: They say Ruby is slow...

      @driven said:

      I've got hypocycloid.py and suPy.rb but I can't get them to run on the Mac, want to take a look?
      I DID download hypocycloid.py John, and looked at the links, viewed some of those videos, the author made at YouTube of his reducer drives. Amazing thing! Didn't know there was such a thing. I have some drive designs that could benefit from a 0 backlash mechanism, but they are not reduction, they would be a 1:3 step-up drive.
      Anyhow... most of what I saw was math, not hard to translate to Ruby. The other thing is the calls to DXF would be tranlated to SU geometry calls, and then you'd use the built-in DXF exporter. Also his py file makes a flat profile, which would need to be pushpull'ed up to a given thickness.
      I noticed... the DXF example at that guy's website had some of the lobes flawed when I loaded it into AutoCAD.
      Anyhow.. have not had time to seriously consider a translation.

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: They say Ruby is slow...

      @jessejames said:

      Well don't give up so easy Dan. I know you to be quite versed in the Ruby language and i think you may also be an accomplished C programmer. Maybe you could offer you expertise to the project? Are you interested?
      Perhaps... my list of to-dos is getting longer and longer. C was one of those languages I had to learn (and like Assembly,) have forgotten more than I remember. I can read it and understand what's happening, but I'd really have to reread the old textbook and play around to get comfy again. Some little Ruby extentions might do the trick.

      @jessejames said:

      ...just don't blame me if you fall in love with the Python language and lament the shortcomings of all others
      Well, there are some things I don't like off the bat with Python. Those hanging indents with no block closures. I was really into Pascal for many years and don't mind the "end" keywords. With the editors we have now, it's nice to have the indent markers that line up the 'begin' and 'end'; I've gotten to rely on those. In Python... wait let me load one of the .py files from SuPy...Ok I see how they will work for Python... a bit strange, but the fold margin gives more info as to where blocks begin and end (at least in notepad++.) I had planned to learn Python for other things, even before I found Sketchup and Ruby.

      @jessejames said:

      PS: i remember a while back you wanting to get wxRuby into the API as a usable GUI kit. I also believe strongly in the power of GUI kits over those atrocious web dialogs. With Python's built in GUI you need look no further!
      Yes, but is it cross-platform, as WxRuby/WxWidgets claims to be? GTK+ or Fx or something else?

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: Ruby extension module using C/C++

      @thomthom said:

      404 - files not found.

      Well.. sorry. I suppose I might have copied them in there manually to try and get SU to use those versions. It seems I remember a previous post awhile back about SU using old msvcrt versions.

      Anyway, the point of the post was where are the DLLs. They are usually put by the application installer into the Windows/System32 folder and registered using regsvr32.exe, but normally the installer is not supposed to overwrite newer versions with older versions. If an application must use and older version, it can keep a local copy in it's program folder and specifically load the local copy. (Which may be how I ended up with copies in the SU folder, I was trying to see SU would use those instead of the ones in my Windows/System32 folder. I have a problem with the MCVCRT and I cannot update several applications, including MS Visual Studio and .NET; something has gotten 'out of whack' on my machine.)

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: Ruby extension module using C/C++

      @thomthom said:

      And how can I obtain this exact DLL version?

      There are two DLLs in the Sketchup folder (msvcp71.dll, msvcr71.dll). These should have been copied to the Windows/System32 folder, and registered. If you explore the Windows/System32 folder and click on the Name column, all the "msvc*" DLL files will be listed together. You can hover over them to see their versions (or right click in the column headers, choose "More..." and check "Product Version" if you always want to see version displayed. You may have to have "Remember each folder's view settings" set in Menu: Tools > Folder Options... > View tab > Advanced settings: listbox.)
      EDIT: corrected filenames in 1st sentence.

      If anyone is interested, attached find a zip with 3 exported 7.x Sketchup RT_MANIFEST files. (Used MSVS to export them,) and gave them a filename with the SU version, and XML extension so they will be properly lexed in editors. (I suppose you could register .manifest extension to use the XML lexer in your editor's settings.).7.x manifest files (XML)
      Did you know?? You can modify manifest files, ie, add dependant assemblies; rename them progname.exe.manifest (where progname is the name of the program,) and put them in the same folder as the executable. When the program loads, Windows automatically looks for an external manifest file, and loads it. An external manifest file trumps a program's internal resource manifest, (so make sure it has the same entries as the internal one, ie: export it using a resorce editor such as Visual Studio.)

      I use an external manifest to force Sketchup to use MS Common Controls ver 6 (aka XP Styled Controls,) instead of those old ugly ver 5 Controls that look like the ones in Windows 3.x !! Vista users might benefit from using Common Controls ver 6.1, but not sure (do not have Vista.)
      Here's the <dependancy> XML tag to add for ver 6.0 Controls:

        <dependency>
      	<dependentAssembly>
      	  <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
      	</dependentAssembly>
        </dependency>
      
      

      There is strange effect when MS Common Controls 6 are ON: the images for the 4 buttons on the left of the Sketchup statusbar don't render (at least on XP, but I don't use those buttons anyway, so it's OK with me.)

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: Ruby extension module using C/C++

      @thomthom said:

      @dan rathbun said:

      There are two DLLs in the Sketchup folder (msvcp.dll, msvcr.dll).
      I do not have these. Closest I got is ...

      Sorry... typo... the files are:
      msvcp71.dll
      msvcr71.dll

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: They say Ruby is slow...

      @jessejames said:

      However, this is a Ruby module and not a REAL Python API. Basically Python calls Ruby code, then Ruby calls SketchUp, very inefficient!

      That SUCKS! dang.. thot I was onto something.

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: They say Ruby is slow...

      @jessejames said:

      It is really a disservice to all of us that Python is not included in SketchUp. Some will argue...
      @unknownuser said:

      Well the dev team does not have time to support another language
      Thats true, just give us the hooks we need and we will write and maintain the Python API and Python API docs, no need to lift a finger!

      Good News for Jesse ! It's already been DONE. It's called SuPy, and the current version is 1.6, written by a guy named Greg Ewing in New Zealand. Here's the link:
      http://www.cosc.canterbury.ac.nz/greg.ewing/SuPy/

      Since YOU are our resident expert in Python... we appoint you to test it out and give us a report:
      (1) Is it faster? (ie: SU Ruby scripts vs SU Python scripts)
      (2) And can SU Python scripts be compiled?

      Anyone think of anymore evaluation questions?

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: New API doc - typos and questions

      Model.get_product_family
      http://code.google.com/apis/sketchup/docs/ourdoc/model.html#get_product_family

      [url=http://forums.sketchucation.com/viewtopic.php?f=180&t=5868&p=236483#p35213:1wad19kf]This thread[/url:1wad19kf] gives a second-hand indication that Model.get_product_family is deprecated and "might be removed from the API at any time."

      So the question(s) I have is:

      Is it ( Model.get_product_family ) really to be considered as deprecated ??

      And if so, should not the API doc (link above,) mention this ( and perhaps direct coders to use Sketchup.is_pro? instead ) ??

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: Ruby extension module using C/C++

      @thomthom said:

      Are they subclassed perhaps?

      Not as far as I can tell.
      UI-Spy shows them as just 'ContolType.Button', ClassName 'Button'
      They are each wrapped inside an edit control, strange because the toolbar buttons are not and they render fine.

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: SDK, optimization, and cross platform support

      @thomthom said:

      How do you make a method that takes an array as argument (or hash) iterates it and return a new one?

      http://www.ruby-doc.org/docs/ProgrammingRuby/html/ext_ruby.html
      Examples (in C,) dealing with arrays are given (although somewhat simple.)

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: [ruby doc] Model - undocumented methods

      [API] Model.get_product_family
      http://code.google.com/apis/sketchup/docs/ourdoc/model.html#get_product_family

      Since this thread was last active (2008,) method .get_product_family has been documented in the API. I find it strange that this method is within the Model class, as it's a application attribute, and belongs within the Sketchup module (or an App subclass of module Sketchup.) I have posted this observation in the 7.x API thread.

      So the question(s) I have is:

      Is it ( Model.get_product_family ) really to be considered as deprecated ??

      And if so, should not the API doc (link above,) mention this ( and perhaps direct coders to use Sketchup.is_pro? instead ) ??

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: HELP setting up a SU code editor

      @driven said:

      @dan rathbun said:

      I'd prefer they run in separate processes, connect by I/O pipes. But in practice it may prove not to be a big deal.

      definitely separate, SU only uses one processor so you really want to be on the other...

      πŸ˜† not processors, John.. processes
      (At Ruby console, type Process.pid and you get the process id number.)

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: HELP setting up a SU code editor

      @chris fullmer said:

      So I thought I should post a link to Pecan's previous work. (SuRDebug)
      See if that is helpful in any way.

      Oh yes.. I had actually downloaded this last December, but have yet to install and try it out.

      As John says it's Win32 only at present, but it's based on the Wx GUIkit, which is supposed to be cross-platform. The editor is based on SciTE Scintilla, and is a bit out of date (SciTE is up over ver 2 now.)
      The thing I didn't 'like' about it (from first blush,) was that Sketchup is run as a subprocess of the editor. I'd prefer they run in separate processes, connect by I/O pipes. But in practice it may prove not to be a big deal.

      Scintilla is also supposed to be cross-platform (the SciTE 1.73 source code ...) STOP ..hold the presses!
      I just checked the ver 2.01 source code of Scintilla, and it now comes with the MacOSX/Cocoa source code [the macosx dir was empty in ver 1.73, and the cocoa dir and it's framework subfolders is new.] And yes there are xcode project files. (EDIT: This is interesting, the Mac/OSX port of Scintilla was written and contributed by Adobe Systems! They needed to make the changes to support their ExtendScript Toolkit. The new code and xcode project files from Adobe were added into Scintilla ver 1.74, which is why my v1.73 folders were empty.) sourceforge link

      I believe SciTE only has distros for Win32 and Linux/GTK+ available so far. (EDIT: The SciTE ver 2.03 page says it's been built and runs on: Windows XP, Fedora 8 and Ubuntu 7.10 with GTK+ 2.12.)

      Hmmm.. things are getting better when things become cross-platform.
      (EDIT: So I am thinking that SciTE, Notepad++ and SuRDebug, all based on Scintilla; could be ported to OSX.)

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: HELP setting up a SU code editor

      @driven said:

      SKSocket doesn't show up under XP....

      I can see it on my PC. At the console type:
      ` defined? SKSocket

      constantIf it were not defined the %(#BF0000)[defined?] keyword would return %(#BF0000)[nil]. SKSocket.methods(false).sort.join("\n")

      outputs:

      add_socket_listener
      connect
      disconnect
      write`

      EDIT: fixed typo: 'defined? SKSocket' was 'defined SKSocket?'

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: HELP setting up a SU code editor

      @driven said:

      so what does this mean?

      It means I made a boo-boo (slappin' 'self up side the head!) 😳

      It's defined? SKSocket

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: HELP setting up a SU code editor

      @driven said:

      Basically, it seems suapi.rb could be the basis for a de-bugger..

      Why re-invent? Ruby has a debugger. It's part of the standard library. It makes more sense to get it working with SU embedded Ruby.

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: HELP setting up a SU code editor

      @driven said:

      @dan rathbun said:

      Nor does: class Sketchup::Geodesic [show on PC]
      only if you don't have Geodesic.rb instaled BEFORE loading suapi.rb

      @dan rathbun said:

      I cant find (mix-in) module Smoothable (is this a plugin?)
      also, only if you don't have Geodesic.rb instaled BEFORE loading suapi.rb
      Again, is Geodesic a Google plugin, or a third-party plugin?

      @driven said:

      @dan rathbun said:

      None of the DC classes or modules are on your list.
      I don't have Pro installed
      It doesn't matter, the DC classes are needed even on Free to interact with Dynamic Components. On the PC, if you turn OFF the DC extension, most of the Attribute Dictionary class methods no longer work.
      The reason they are not enumerated / cataloged by su_api.rb is, that the script specifically ONLY targets modules Sketchup, UI and Geom. (I don't know this was by design, or honest omission.)

      @driven said:

      @dan rathbun said:

      The following classes, don't have prototypes defined (BUT SHOULD!):
      UI::InputPoint [*no-proto]
      REVISED**
      UI::Menu [*no-proto]REVISED
      UI::PickHelper [no-proto]REVISED
      UI::Tool [no-proto]

      why??? Not sure what you mean here, but it may come to me if they suddenly turn up
      REVISED:
      InputPoint is defined as:Sketchup::InputPoint
      Menu is defined as:Sketchup::Menu
      PickHelper is defined as:Sketchup::PickHelper
      (..and they ARE on your list.)
      The confusion comes because the API doc lists them under "UI Classes".
      The Tool class is weird. There is no prototype for coders to subclass, and this is often confusing for newbies. Sketchup treats an object as a tool, when the object is passed as the arg to Model.select_tool.

      @driven said:

      @dan rathbun said:

      *Sketchup::FrameChangeObserver [no-proto]
      Is this a Pro thing?
      No, it's general. The sample in the Sketchup Blog shows how to use it with Dynamic Components (but it likely can be used for other things.)
      The weird thing is, it doesn't really matter what this class is named, when you attach an instance of this observer class, Sketchup only cares that it have a callback method named 'frameChange'.
      But not having a 'prototype' of the class (for coders to subclass,) will mean that it will never show up in the API docs. Also, the Blog example, adds in a PC bug workaround. If this workaround was written into a proto-class then any custom subclass would inherit the 'fix'.
      The example is named 'scenes.rb' you can download a nice formatted copy at:
      http://www.smustard.com/forum/viewtopic.php?f=9&t=25#p47
      and the Blogpost can be read here:
      http://sketchupapi.blogspot.com/2009/07/dynamic-components-that-react-to-scene.html

      @driven said:

      @dan rathbun said:

      And then the standard extensions:
      LanguageHandler ( should be moved to -> UI::LanguageHandler )
      SketchupExtension (should be moved to -> Sketchup::Extension )

      possibly Mac thing, but are you see the pattern emerging?
      This occurs because su_api.rb specifically does not look for these classes, so they don't get enumerated / cataloged.

      @driven said:

      I know there other factors, but we can test against installed version of Ruby as well as other...
      Just a reminder that Win32/PC platform does not come with Ruby installed. There are users who would not understand how to install (or more so maintain,) a full Ruby installation. I'm thinking about a scenario where a PC (perhaps even a Mac,) can have a 'normal' full Ruby install in the normal place; AND a second full install under the Sketchup directory that is 'tweaked' specifically for use with Sketchup (and in the future hopefully Layout.)
      That way the normal install can stay normal, and be used for things like Rails, without affecting SU. The opposite would be true as well. I've already manually copied a full 1.8.6 install into my SU folder. (This way I can have a 1.9.1 install in the root of my system, that is separate, as Sketchup can't handle v1.9.x at this time.)

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: HELP setting up a SU code editor

      @thomthom said:

      Are you trying to write SU plugins with Ruby on Rails?

      It's only one of John's ideas he's playing with. No harm in playing. Specifically I think he's thinking of it as perhaps a WebDialog/WebApplet platform.

      If such a 'plugin' ran from a remote website or network server, I can see that it may have merit.

      I have reservations however if Rails were to be used as a local WebDialog platform, as it's a server technology, and each client would need to have a full Ruby install along with RubyGems and Rails. That raises install headaches on the PC side. (Personally, I am nervous having servers run on my client machine, with an always on, broadband internet connection.)

      I'd be interested to see if we could get eruby running under SUruby as a WebDialog helper.

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: HELP setting up a SU code editor

      @driven said:

      @dan rathbun said:

      Why re-invent? Ruby has a debugger.
      Not, a all, I 'm meaning some sort of version control / monitor / indicator, so if I write what I think is a really simple beginners type ruby, with only SU6 on a Mac available for testing, my editor can highlight the fact I've used a Win32 only method that also needs MeshAdditions.rb + Geodesic.rb or wharever... before it will run on my machine.

      Oh OK, well then debugger is the wrong term for what you want. And we've discussed something similar before in other threads, Rick Wilson had an experimental approach that was implemented as embedded documentation, that would need to be parsed. I think they were 'leaning' toward a RDoc-like syntax.

      Myself, and I think Jim Foltz prefer something that is 'live-Ruby.' Where a ruby script, (or a module distro'd with Sketchup,) tasked with Extension management, can actually ask the plugin / extension about itself.

      Right now, if you have ever used the SketchupExtension class, you should realize that it creates a Ruby object (before an extension / script is actually loaded and only loads it if the user has 'checked the box' in the Extensions page of the Preferences dialog. The SketchupExtension class object contains (at present,) only a handful of attributes, but if you compare them to those within a GEM spec ... you should find the the GEM spec has an attribute for almost all those in the SketchupExtension object; plus quite a few more.

      I would prefer either adopting the GEM spec format, or as close to it as possible; and revise the SketchupExtension class (rev 2?, which should really be Sketchup::Extension class,) to add extra attributes, stealing those from GEM spec that apply, and adding some specific Sketchup attributes (such as a platform attribute: 'PC','Mac' or 'Both') It should be possible to add attributes to the class, and still be backward compatible, ie, the current SU Extensions dialog will just ignore all the extra attributes.

      Looking forward.. a future SU version could 'grey-out' the checkbox if the extension does not support the user's platform, or if the user's installation does not have modules or classes that are listed in the 'dependancies' attribute(s). This could work for 'conflicts', where the checkbox does not become active until conflicting extensions have been unchecked.

      So, then.. an editor / IDE could also access this information. If Sketchup is loaded, the IDE could iterate and query the Extensions collection to determine what it needs to know. If SU is not loaded, the IDE could start it's own Ruby instance, and run a script that can build it's own SU Extensions collection.

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • 1
    • 2
    • 230
    • 231
    • 232
    • 233
    • 234
    • 245
    • 246
    • 232 / 246