sketchucation logo sketchucation
    • Login
    1. Home
    2. Dan Rathbun
    3. Topics
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download
    Offline
    • Profile
    • Following 0
    • Followers 1
    • Topics 92
    • Posts 4,903
    • Groups 2

    Topics

    • Dan RathbunD

      Sketchup.send_action arguments: Mac vs PC

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      10
      0 Votes
      10 Posts
      3k Views
      B
      This is an old thread, but I'm adding a tip here that may be of help to other developers who may discover this info... In an effort to create a toolbar button to show the "Entity Info" palette (there's a built-in button for Model Info, but oddly not for Entity Info), I couldn't find a method or action that worked on the Mac. There is a fixnum constant value for the PC, but these don't seem to work on the Mac, even after years of SketchUp evolution on the Mac. Then I stumbled on the get_shortcuts method... Using the "Shortcuts" pane within the "Preferences" window, you can add a shortcut to the command for which you need the string constant, then using: Sketchup.get_shortcuts.sort ...you can discover the string that can successfully be used with the Sketchup.send_action method. For example, I added the F2 key to "Window/Entity Info", and got the following output: Sketchup.get_shortcuts.sort ["A\tselectSelectionTool:", "B\tselectPaintTool:", "C\tselectCircleTool:", "E\tselectEraseTool:", "F\tviewZoomExtents:", "F2\tentityProperties:", "G\tmakeGroup:", "H\tselectDollyTool:", "K\ttoggleDisplayBackEdges:", "L\tselectLineTool:", "O\tselectOrbitTool:", "P\tselectPushPullTool:", "R\tselectRotateTool:", "S\tselectScaleTool:", "T\tselectMeasureTool:", "V\tselectMoveTool:", "Z\tselectZoomTool:", "`\ttoggleHideRestOfModel:", "~\ttoggleHideSimilarComponents:", "⇧G\t/Edit/Context Menu Flyout/Explode"] In there, you'll see "F2\tentityProperties:", so the string constant is "entityProperties:". Voila, a method to discover undocumented action strings.
    • Dan RathbunD

      Source Code Indentation : Why certain amount?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      19
      0 Votes
      19 Posts
      1k Views
      thomthomT
      I want elastic tabstops!
    • Dan RathbunD

      [Example] box.rb version 2.0.0

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      9
      0 Votes
      9 Posts
      3k Views
      Dan RathbunD
      @edson said: would you care to explain what is the difference between your version and the one that packs with sketchup? I did in the first post of this thread. I wrapped the original code like thus: module Examples module SU module Box # the original create_box method end # Box end # SU end # Examples In addtion I made the create_box() method a module function (see Ruby Pick-Axe book: module_function) I also made a small correction, by moving the last line up inside the preceeding if block. I marked all lines that were added or moved. Wrapping the code, in it's own namespace prevents it from being corrupted by scripts that load afterwards, that have methods (or other objects,) with the same name. What was happening was, that after box.rb loaded, then later make_pano_pm.rb would load, and it ALSO had a method named " create_box". Since neither script (originally) was wrapped in a module they were actually defining methods within the SAME namespace (which is class Object.) Whenever Ruby reads a method definition of a method that is already defined, it deletes the old method, and replaces it with the new one. So.. make_pano_pm.rb was redefining the create_box() method that both scripts were trying to use,... BUT the latter one was not written to work with both scripts, and users trying to use box.rb would never see the box dimensions input dialog appear. If you did not have make_pano_pm.rb in your Tools folder (dir,) then box.rb would work normally, and you would not notice anything amiss. I did NOT change or improve box.rb to be a better plugin, because it's not a plugin. It's really a simple code snippet, to be used as an example and a base, from which ruby-newbie's are to play with and improve themselves, thereby learning by doing.
    • Dan RathbunD

      [API] ShadowInfo

      Watching Ignoring Scheduled Pinned Locked Moved SketchUp Bug Reporting sketchup
      6
      0 Votes
      6 Posts
      2k Views
      Dan RathbunD
      @wehby said: I guess it would be possible for a Ruby programmer to access the same locations.dat file to automate that process. It's just a comma-delimited text file. No problem there. Format (sorted in left-right field order): "Country", "City", Long, Lat, TZOffset Long, Lat, TZOffset are Float (W Long neg; S Lat neg; TZOffset sign ref to UTC.)
    • Dan RathbunD

      Open Komodo

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      2
      0 Votes
      2 Posts
      443 Views
      R
      I thought the post was Open Kimono. Boy was I disappointed.
    • Dan RathbunD

      DC / Dictionary Interaction

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      8
      0 Votes
      8 Posts
      301 Views
      thomthomT
      hm... I need to look into this. Check what happens with my scripts under SU6... Pauline: sorry for going a bit off topic. Maybe it's best if I split these last couple of posts into a new thread? Ok, Pauline & Dan? Edit: Now split of - as you can see.
    • Dan RathbunD

      DC Toolbar slowing Sketchup?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      2
      0 Votes
      2 Posts
      167 Views
      J
      Yep, I've noticed this slow-down also. For me, it seems to be worst when I simply select a lot of geometry. Probably more noticeable on older machines.
    • Dan RathbunD

      HLR.parent BUG SPLAT!

      Watching Ignoring Scheduled Pinned Locked Moved SketchUp Bug Reporting sketchup
      6
      0 Votes
      6 Posts
      2k Views
      Dan RathbunD
      @unknownuser said: ... let's see what HLR stands for? Hyper Lazy Render ? Apparently it stands for Hidden Line Renderer (or similar.) If Sketchup::HLR is a private internal class, meant only to be used by Sketchup itself, it's constructor method should be made private (and/or renamed.) In addition, the API should probably tell us not to mess with it.
    • Dan RathbunD

      Thumbnail Checkbox / Model.name / Model.tags

      Watching Ignoring Scheduled Pinned Locked Moved SketchUp Feature Requests sketchup
      3
      0 Votes
      3 Posts
      2k Views
      Dan RathbunD
      @dan rathbun said: It would be better (or more natural) if the 'Redefine Thumbnail(s) on Save' checkbox, was located on the 'General' page, in the 'Saving' section, of the 'Preferences' Dialog (ie: it would/should be a global setting for all models.) I understand as it is now, redefine Thumbnail on Save is a per-model setting. (1) I would like to override this globally (and perhaps temporarily,) withoutchanging the setting within the model. (2) I WISH for a global setting that defines a Scene (Page) name, and if the model has a page so named, the built-in Save command would use THAT scene AND it's camera location, to create the thumbnail that is stored with the model, INSTEAD of the current view. (3) This might be combined with a user setting at the model level, for a thumbnail scene (page). Currently I have to write my own command to do this... but if I forget and click the normal Save button (or Use File > Save on the Menu,) the thumbnail will get overridden by the current page, which will be 'Working' or some other Scene page.
    • Dan RathbunD

      Redefine Thumbnail on Save (Control)

      Watching Ignoring Scheduled Pinned Locked Moved SketchUp Bug Reporting sketchup
      1
      0 Votes
      1 Posts
      581 Views
      No one has replied
    • Dan RathbunD

      STD IO .isatty produces BUG SPLAT!s

      Watching Ignoring Scheduled Pinned Locked Moved SketchUp Bug Reporting sketchup
      3
      0 Votes
      3 Posts
      883 Views
      Dan RathbunD
      @andrews said: Next time this happens, when you fill out the Bug Splat report, put in some sort of keyword ... I think I did, did I not do both? My post here IS the followup. In each of the 4 explaination(s) in the Bug Splat! reports, I wrote almost identical notes (but the receiver of the ".isatty" method changes per the list at the top of this thread.): @unknownuser said: Ruby Console: $stdin.isatty --> BUG SPLAT! So take your pick, try searching on ".isatty" Not that important anyway. Interesting that $stdout and $stderr raise "NoMethodError: undefined method `isatty'" The Sketchup::Console class needs a major overhaul. We need to be able to use STDIN, STDOUT and STDERR to implement our own Console Applets / Debuggers, or integrate with thrid-party Ruby IDEs. There is a glaring 'perfect' space for controlling such a feature on the 'Applications' page of the 'Preferences' dialog.
    • Dan RathbunD

      [Code] Ruby Extension for Sketchup color integers

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      7
      0 Votes
      7 Posts
      2k Views
      Dan RathbunD
      Added to the original post (root of thread,): Clarification: As discussed in the thread below... these methods really belong within the class to which they provide benefit and functionality. This class or classes, would be any Color object class that is defined in ruby, for whatever purpose. The example code can be rewritten slightly, so as to make it a generic mix-in module, for including in any Color class definition. In this way any Color class could inherit the conversion methods in the mixin module. Such a module would have as it's first line "module ColorIntegerConversion" instead of "class ::Integer", and this will be the way that it would be submitted for Standard Ruby, NOT as an extension to the ruby base Integer class.
    • 1 / 1