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: New API doc - typos and questions

      **Geom::Point3d.-**
      http://code.google.com/apis/sketchup/docs/ourdoc/point3d.html#-

      @unknownuser said:

      Returns:
      vector a Vector object
      There is no defined object named 'vector', but there IS one named ' Vector3d'. If we follow the example the class of the result is given as Geom::Vector3d.

      pt2 = Geom;;Point3d.new(100,200,300)
      pt3 = pt2 - [1,1,1]
      >> Vector3d(99, 199, 299)
      pt3.class
      >> Geom;;Vector3d
      

      It seems a bit strange that + returns Point3d, but - returns Vector3d.

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

      Geom::Point3d.+
      http://code.google.com/apis/sketchup/docs/ourdoc/point3d.html#+

      @unknownuser said:

      The '+' operator is a fast way to add to the current x, y and z values of a point, or to set the values of a point by adding to other points together.
      The end of the sentence should read, "...by adding **two** other points together."

      @unknownuser said:

      Returns:
      vector a Vector object
      There is no defined object named 'vector'. If we follow the example the class of the result is given as Geom::Point3d.

      pt2 = Geom;;Point3d.new(100,200,300)
      pt3 = pt2 + [1,1,1]
      >> Point3d(101, 201, 301)
      pt3.class
      >> Geom;;Point3d
      

      @unknownuser said:

      Arguments:
      point2 A Point3d object.
      An ArugemtError exception is raised if point2 is a Point3d object.
      Valid argument classes are: Array or Vector3d. This means to use a Point3d as an argument, you must convert to Array. Example:

      pt3 = pt1 + pt2.to_a
      

      This method needs to be fixed to take a Point3d object and internally convert it to an Array...

      # internal to + method
      if arg[0].is_a? Point3d { arg[0]=arg[0].to_a }
      

      ...or a Vector3d:

      # internal to + method
      if arg[0].is_a? Point3d { arg[0]=[0,0,0].vector_to(arg[0]) }
      

      either way. The current implementation is clumsy.

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: Suppress warning Your recent operation...

      @tig said:

      @thomthom said:

      TIG, I think it's a native SU warning, not a ruby script warning. So I'm not sure if that can be suppressed at all...

      Well, in that case it can't be suppressed... it's there for a reason ๐Ÿ˜’

      If the warning is sent to the console via STDERR, you may be able to suppress it by changing the setting for $VERBOSE.
      See this post in the Optimization thread.
      http://forums.sketchucation.com/viewtopic.php?f=180&t=25305#p217508

      If it's a viewtip or a messagbox in a .rbs, well ...

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: Observers WhishList

      FrameChangeObserver

      @thomthom said:

      Why doesn't this observer have its own class documented as the other observers? http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/pages.html#add_frame_change_observer

      I would guess that this was a pre-version 6 observer implementation, added before they 'set a standard' in version 6 for true observer prototypes defined under the Sketchup module. And that when they did add those formally defined Observer classes in version 6, this one fell through the cracks.

      I checked the Object list... and there is no observer prototype named 'FrameChangeObserver' defined.
      I checked the Sketchup::Pages class for it's methods:

      pages.public_methods(false).sort
      ["[]", "add", "add_matchphoto_page", "add_observer", "count", "each", "erase", "parent", "remove_observer", "selected_page", "selected_page=", "show_frame_at", "size", "slideshow_time"]
      

      There are NO methods:

      • add_frame_change_observer* remove_frame_change_observer
        This information is OBSOLETE in the API, and should be removed.

      A coder (currently) would have to use the Sketchup::ViewObserver, onViewChanged method to detect when the change of view finished.

      IF there is a need (for the functionality of a FrameChangeObserver,) you might propose a Sketchup::AnimationObserver class that has this callback function and perhaps others?

      Jim might want to weigh in on this, as he has been working on Animation lately.

      @Jim : Questions:

      • Would an attached AnimationObserver be expected to slow the framerates?* Would an AnimationObserver even be necessary? (As really the Animation interface, is somewhat like an observer itself. The pause, resume and stop methods act like observer callbacks.)
        _
      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: Optimization Tips

      $VERBOSE controls messages and warnings that get set to STDERR.

      Set to nil so SU Ruby doesn't waste time spitting out useless warnings about sloppy code (like "warning: meaningless use of == in nil context") which noone wants to read anyway (when they're doing modelling.) Or my other favorite "warning: parenthesize arguments for future version."

      Settings:
      $VERBOSE = nil : sets 'Silent' mode
      $VERBOSE = false : sets 'Medium' mode (default)
      $VERBOSE = true : sets 'Verbose' mode

      These settings correspond to ruby start parameter -W with values of 0,1,2 (which would also set $VERBOSE in a standard Ruby Environment.)

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: How to install a Ruby Gem for use in SketchUp

      @adamb said:

      ... I don't know why Google are shipping quite so old a dll. ...
      It may just be a staffing issue, they know it works with 1.8.0, but are probably reluctant to ship with 1.8.6 without massive testing. I can see management feeling such an task as being low priority.

      There was also at least one person at Google, who thought wrongly (the removed quote above,) that Ruby for Sketchup had to remain at v1.8.0 because the DLL (they thought,) had been extensively modified and compiled specially for Sketchup; and that to update to 1.8.6 or any other later release would be a huge project, not likely to occur any time soon.
      __Well, I think I've proved that assumption incorrect. The Ruby Interpreter DLLs are just copies of those distro'd with standard Ruby.

      @adamb said:

      Given there are many fixes between 1.8.0 and 1.8.6 - and using 1.8.6 doesn't seem to cause problems - ... In particular, I noticed a few fixes in the changelogs to Ruby related to memory leaks.
      A good reason to use 1.8.6 with Sketchup, and I have been since a few days after I installed 7.0 (and have had no problems, so far.)

      I would feel that 1.8.7 is still not ready (it just had a recent release to fix major security bugs.) But it's almost there.

      I tried to get Sketchup to load 1.9.1, but it did not like the DLL. I got the 'Entry Point Not Found' error. (Not sure if it was the Ruby guys who changed things, or if it was me renaming the msvcrt-ruby191.dll to msvcrt-ruby18.dll that was the problem.)

      There are those of us, who wish to run newer Ruby releases (especially the non-english users who need multibyte character support in the 1.9.x branch.) We should be able to run any Ruby release we wish.. and it would be nice if Sketchup was setup to facilitate our choice.

      @adamb said:

      FYI Mac Sketchup uses 1.8.5
      I suspect because of the major differences in OSX and Win32 programming, that there are different people working on the two implementations.

      Does OSX Leopard come with ver 1.8.5 pre-installed?
      _

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: How to install a Ruby Gem for use in SketchUp

      Re: Ruby Interpreter DLL: SketchUp vs Standard

      The Support Tool bindiff.exe reports both files are identical.

      DOS cmd shell in folder:
      C:\Program Files\Google\Google SketchUp 7_Backup

      >bindiff /c msvcrt-ruby18.dll v180-10\msvcrt-ruby18.dll
      
      Identical  811,008 bytes
      
      File Count Summary
         Identical;      1 files
         Near Identical; 0 files
         Different;      0 files
         Left Only;      0 files
         Right Only;     0 files
         Errors;         0 files
         Total;          1 files
      
      Byte Count Summary
         Matched;    0 bytes differ
         Left Only;  0 bytes
         Right Only; 0 bytes
         Total;      0 bytes
      
      

      *(bindiff is a binary file comparison utility that is installed with Windows Support Tools. The Support Tools are not installed automatically with Windows. You must manually browse the WIN install CD to the "Support Tools" folder, and run a separate setup.exeto install the tools.)

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: Notepad++

      @huckrorick said:

      I didn't know you could execute a file directly from Notepad++. The way ...[snip]... did you discover a more direct way to do it?

      NewOne explains how to do it, on page 1 of this thread, here's the direct link:
      http://forums.sketchucation.com/viewtopic.php?f=169&t=6903&st=0&sk=t&sd=a#p137855

      You need to install the NPPEXEC extension first. It helps if you have the PluginManager extension installed.
      Plugins > PluginsManager > show...
      Available (tab) > Hilite NPPEXEC and click 'Install' (button)

      posted in Freeware
      Dan RathbunD
      Dan Rathbun
    • RE: How to install a Ruby Gem for use in SketchUp

      Re: Ruby Interpreter DLL: SketchUp vs Standard

      The Support Tool filever.exe displays versioning information inside exe and dll files:

      DOS cmd shell, filever verbose listing, in folder:
      C:\Program Files\Google\Google SketchUp 7_Backup
      This is the DLL file distro'd with Sketchup 7.x

      >filever msvcrt-ruby18.dll /v
      --a-- W32i   DLL   -         1.8.0.0 shp    811,008 02-19-2009 msvcrt-ruby18.dll
      
              Language        0x0000 (Language Neutral)
              CharSet         0x04b0 Unicode
              OleSelfRegister Disabled
              FileDescription Ruby interpreter
              InternalName    msvcrt-ruby18.dll
              OriginalFilenam msvcrt-ruby18.dll
              ProductVersion  1,8,0,0
              FileVersion     1,8,0,0
              LegalCopyright  Copyright (C) 1993-2003 Yukihiro Matsumoto
              OleSelfRegister Disabled
      
              VS_FIXEDFILEINFO;
              Signature;      feef04bd
              Struc Ver;      00010000
              FileVer;        00010008;00000000 (1.8;0.0)
              ProdVer;        00010008;00000000 (1.8;0.0)
              FlagMask;       0000003f
              Flags;          00000000
              OS;             00000004 Win32
              FileType;       00000002 Dll
              SubType;        00000000
              FileDate;       00000000;00000000
      

      This is the DLL file distro'd with Ruby ver 1.8.0-10

      >filever v180-10\msvcrt-ruby18.dll /v
      --a-- W32i   DLL   -         1.8.0.0 shp    811,008 08-11-2003 msvcrt-ruby18.dll
      
              Language        0x0000 (Language Neutral)
              CharSet         0x04b0 Unicode
              OleSelfRegister Disabled
              FileDescription Ruby interpreter
              InternalName    msvcrt-ruby18.dll
              OriginalFilenam msvcrt-ruby18.dll
              ProductVersion  1,8,0,0
              FileVersion     1,8,0,0
              LegalCopyright  Copyright (C) 1993-2003 Yukihiro Matsumoto
              OleSelfRegister Disabled
      
              VS_FIXEDFILEINFO;
              Signature;      feef04bd
              Struc Ver;      00010000
              FileVer;        00010008;00000000 (1.8;0.0)
              ProdVer;        00010008;00000000 (1.8;0.0)
              FlagMask;       0000003f
              Flags;          00000000
              OS;             00000004 Win32
              FileType;       00000002 Dll
              SubType;        00000000
              FileDate;       00000000;00000000
      
      

      *(filever is a file version utility that is installed with Windows Support Tools. The Support Tools are not installed automatically with Windows. You must manually browse the WIN install CD to the "Support Tools" folder, and run a separate setup.exeto install the tools.)

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: How to install a Ruby Gem for use in SketchUp

      Re: Ruby Interpreter DLL: SketchUp vs Standard

      I downloaded the normal standard v 1.8.0 patch level 10 DLL (msvcrt-ruby18.dll) from:
      http://www.oldapps.com/Ruby.php?old_ruby=12
      and compared it against the backup that was installed with Sketchup v7.0 application.

      Both standard DOS command comp and the Support Tool WinDiff report both DLL files are identical.

      *(WinDiff is a file comparison utility that is installed with Windows Support Tools. The Support Tools are not installed automatically with Windows. You must manually browse the WIN install CD to the "Support Tools" folder, and run a separate setup.exeto install the tools.)

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: Uniq! not working ?

      @mitcorb said:

      Excuse me for stepping in here.
      Out of curiosity, are there a lot of terms like "uniq" in the ruby language? Couldn't this get confusing?

      Many of the method names came from Unix and Perl, so they are familiar to people with that background. Well there are some 'shortened nicknames', such as: assoc, eql, attr, dup, eval, stat, sync, const, undef,... etc. sprinkled throughout ruby modules, but No not a majority. A very small minority in fact. But you get used to them.

      @mitcorb said:

      Or can you use interchangeably "unique"?

      You could (if you felt more comfortable,) create singleton methods that provide an alias.

      
      arr = [1,2,1,3,4]
      
      def arr.unique!
        self.uniq!
      end
      
      arr.unique!
       >> [1,2,3,4]
      
      arr2=[5,6,7,5]
      arr2.unique!
       >> Error; #<NoMethodError; undefined method `unique!' for [5, 6, 7, 5];Array>
      
      
      

      So it only works for the single instance 'arr'.
      This avoids globally changing Base classes, which most people get upset about.

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: Notepad++

      Another difference betwen the two editors.

      I belive SciTE lets you execute scripts from the editor without saving them.

      Notepad++ won't execute the script unless it's saved first. (I get an file 'such-n-such.rb' not found error.)

      posted in Freeware
      Dan RathbunD
      Dan Rathbun
    • RE: Notepad++

      @huckrorick said:

      If I remember correctly you were going to start using Notepad++ (but hadn't used it yet). Did you start?
      Yes.. I've been using it for the past 2 days.
      Much easier to change settings (colors, etc.) using the dialogs, then those 'properties' files that SciTE uses!

      @huckrorick said:

      Do you have the file for autocompletion? (I think there are more than one around.)
      Yes.. I've found that the file made by radhikari has more entries in it.

      Altho... I think I would have done it differently. For instance many method names have '(UI::Toolbar)' [ie, the qualification after them], which gets pasted in, and you then have to backspace over it, as it doesn't belong there.

      I'll have to find time, to play around with the API file sometime.

      ALSO... the file(s) were just modified FULL ruby files. Many of the listed modules and classes (and their methods,) are for Full Ruby, and are not available to Sketchup Ruby (unless a user has a full ruby install AND has paths to the full Ruby folders set.)

      posted in Freeware
      Dan RathbunD
      Dan Rathbun
    • RE: How to install a Ruby Gem for use in SketchUp

      @unknownuser said:

      Dan: thanks, that was the problem. in Sketchup there were msvcrt-ruby18.dll version 1.8.0 and in Ruby was version 1.8.6

      replacing the dll in Sketchup dir with the one from Ruby dir I was able to load RubyProf

      I thought so!

      I always tell people, IF your using full ruby libraries with Sketchup... to make the msvcrt-ruby18.dll file in the Sketchup program folder/directory, the SAME version as your full ruby version. Otherwise your asking for Errors (such as newer library scripts calling methods that the older interpreter doesn't understand.)

      I've given this advice several times over at Google Groups SU Developer's forum. Not sure if I have here. I also always say make a Sketchup/_BACKUP folder and drag the older DLL into that folder, before copying the newer 'full' DLL from the ruby/bin folder. (You never know, you may have a future need to test a script, running under the old DLL version.)

      Glad I could help.

      @Jim: Maybe this issue needs to be added to the Ruby Tips for Sketchup Sticky Links page?

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: Notepad++

      @huckrorick said:

      I'm new to both notepad++ and Ruby.
      Notepad++ in Settings>Backup/AutoCompletion allows you to choose "Function parameters hint on input". I checked this box but don't see any results when I'm writing a program.
      (I checked into this...) The API file is not set up to do function parameters.

      @huckrorick said:

      Does it require another file like the autocompletion does?
      No. Same file, just extra nested XML tags. Alot of work.
      And it may not work well with ruby. The 'feature' was designed for a 'functional' language like C, where mostly a function always has the same return type, and the same number of arguments. Ruby can be variable in both respects.

      posted in Freeware
      Dan RathbunD
      Dan Rathbun
    • RE: How to install a Ruby Gem for use in SketchUp

      @unknownuser said:

      when in Sketchup, require 'ruby_prof.so' breaks in LoadLibrary function with 'Exception C0000139 Entry Point Not Found' which is weird as it works in normal Ruby

      What version is the msvcrt-ruby18.dll...

      ...that works in normal ruby?

      ...that does NOT work in the SU folder?

      (I got a similar error when I tried to get SU to load the 1.9.1 version ruby dll)

      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • RE: Uniq! not working ?

      @remus said:

      ...to try and create an array of the faces connected to a face...

      EdgeUse.partners
      http://code.google.com/apis/sketchup/docs/ourdoc/edgeuse.html#partners
      @unknownuser said:

      The partners method is used to retrieve all of the partner edge uses. This method allows you to find all Faces that use an edge.

      EDIT: Never-mind. I think the flatten! array means by ThomThom is much simpler. Compact code, let ruby do the hard work.

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

      OptionsProviderObserver.onOptionsProviderChanged
      http://code.google.com/apis/sketchup/docs/ourdoc/optionsproviderobserver.html#onOptionsProviderChanged

      @unknownuser said:

      The onOptionsProviderChanged method is invoked when an element is added to an Pages object.

      Should read, "The onOptionsProviderChanged method is invoked when an option is changed for an OptionsProvider object."
      _

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

      Set class
      http://code.google.com/apis/sketchup/docs/ourdoc/set.html

      This class is defined in the Objectspace and should be listed under "Core Ruby Classes" (along with Array, Length, Numeric and String.)

      Instead it's buried under "App Level Classes" and listed with all those classes that are defined inside the Sketchup module.
      _

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

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

      @unknownuser said:

      options_hash______ A hash containing the COLLADA (.dae) export options.

      The options listed in the hash example is missing the option for hidden geometry.
      The Registry Attribute Name is "ExportHiddenGeometry", but what is the options hash key?

      • hiddengeometry ?* hidden_geometry ?
        _
      posted in Developers' Forum
      Dan RathbunD
      Dan Rathbun
    • 1
    • 2
    • 238
    • 239
    • 240
    • 241
    • 242
    • 245
    • 246
    • 240 / 246