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

      [Code] custom file_loaded() and file_loaded?() v2.0.0

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      11
      0 Votes
      11 Posts
      6k Views
      Dan RathbunD
      OK.. so, for those you who have read the thread.. looked at the template, and scratch your head and wonder why all the complexity to control a private array ?? Answer.. it's just an example, of a private library mixin module. In practice, you can rename the mixin module to whatever you like... and insert whatever proprietary functionality you wish to include in only YOUR plugins (ie, methods in the mixin sections, other class variables and constants, etc.) whilst not allowing some other "hack" to use those features in their plugins.
    • Dan RathbunD

      [Code] Set class fix v0.3.2

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      9
      0 Votes
      9 Posts
      2k Views
      tt_suT
      I would recommend using the Standard Library Set class over the one in SketchUp if you can. It's better features and much faster. We might be deprecating the Sketchup::Set class eventually. With the standard lib it doesn't make any sense for anything other than backward compatibility.
    • Dan RathbunD

      [Code] intersect_with?() Group test method

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      2
      0 Votes
      2 Posts
      1k Views
      B
      Hi, May I know after determining if the 2 groups/ components/ faces are intersected. How do I get the area of the intersection?
    • Dan RathbunD

      [Patch] to "sketchup.rb" (beta) v 1.1.0

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      10
      0 Votes
      10 Posts
      1k Views
      Dan RathbunD
      @thomthom said: @dan rathbun said: The registration script adds 4 patches to the Preferences (dialog) > Extensions (panel) list. Why have a patch in the extension list? Why would an end user ever need to enable/disable this? Don't you think it can cause confusion? @dan rathbun said: I have separated each patch into it's own file, so it can be switched on/off, tested and updated individually. Formost.. for testing. But as sometimes happens, patches can either introduce other unforseen issues, or perhaps a very popular plugin relies on some quirkiness that the patch fixed. Because it may be large and complex, the author of this "example" popular plugin, needs time to update his code. So the patch can be switched off.. until an update is issued. Patches, in general: I have thought many times upon a patching system, similar to the extension system. I imagine it having it's own checklist, separate from the plugin checklist.
    • Dan RathbunD

      The $sketchup_version global var

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      5
      0 Votes
      5 Posts
      623 Views
      Dan RathbunD
      @driven said: is there a similar way for PC's? Well, John, we would use within Ruby the cross-platform method call: puts Sketchup.version() Add: From the shell, there IS a command line utility, that can ask EXE and DLL files what their version is (provided they followed certain rules before compiling.) Some Ruby specific DLL files do not do this, and most SO files don't. I just cannot remember offhand what the name of the utility is ... EDIT: I now rememeber the utility on PC, it's: %(#BF4000)["C:/Program Files/Support Tools/filever.exe"] If you have the "Support Files" installed it's likely it's folder is in your path... so if your in the Sketchup program directory... %(#BF4000)[filever sketchup.exe] %(#000000)[>>] %(#BF4000)[--a-- W32i APP ENU 8.0.11752.0 shp 12,152,832 11-26-2011 sketchup.exe]
    • Dan RathbunD

      Showing images, on the view, in a tool ?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      2
      0 Votes
      2 Posts
      61 Views
      thomthomT
      I also wish to draw GL bitmap. Haven't found a way. @dan rathbun said: but when the tool deactivates they vanish. That I don't think you can do anything with...
    • Dan RathbunD

      [Code] GE "GeoLocation" AttributeDictionary v1.1.0

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      1
      0 Votes
      1 Posts
      854 Views
      No one has replied
    • Dan RathbunD

      ACT / Film and Stage Extension Strings

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      197 Views
      Dan RathbunD
      Thanks John... seemed to paste OK into Notepad. I saved as UNIX EOLs, and "UTF-8 without BOM". Will try it tomarrow.
    • Dan RathbunD

      [Code] Scarpino's SphereUtil Sample ver 1.1.0

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      1k Views
      Dan RathbunD
      Fixed a small booboo (see the docheader in file.) @John.. perhaps a good example tool, to make a path, might be a modified edition of the "Examples/linetool.rb"
    • Dan RathbunD

      [Code] Scarpino's SphereTool Sample ver 2.1.0

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      15
      0 Votes
      15 Posts
      4k Views
      Dan RathbunD
      @driven said: I'll make some nicer ones if you want, this was my first attempt at making icons in SU... john A note about toolbar icons. GIFs are not the best. (They are good for print ads, cartoons, etc.) But the edges look ragged. You should save as PNG, as the edges are anti-aliased. (smoothed via blending.)
    • Dan RathbunD

      [Code] FAQ: Detect if plugin is running on the Mac vs PC ?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      6
      0 Votes
      6 Posts
      2k Views
      Dan RathbunD
      Neither do I, as I had said in the OP.
    • Dan RathbunD

      [Bug] model.valid?() on PC

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      73 Views
      Dan RathbunD
      I do not know if it is new. I just ran across it. Could not find a bug report, so I filed one. This post is just a "head's up" notice.
    • Dan RathbunD

      [Plugin Library] Win32API and Win32OLE so files

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      21
      0 Votes
      21 Posts
      21k Views
      Dan RathbunD
      FYI SketchUp 2014 Ruby v 2.0.0 - patchlevel 247 win32ole.so file is included Win32API.rb file is included, which is a wrapper into the newer DL library, but allows the older WIn32API style calls. %(#BF4000)[Do not copy these files from older Ruby versions into SketchUp's "Plugins" folder, (or any of SketchUp's folders,) for versions 14 or higher !]
    • Dan RathbunD

      [Code] Selection dependant menu item macros

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      1k Views
      Dan RathbunD
      Your welcome. The example is very basic.. and only adds one item to the menus. The user can expand it to add more than one item to the menus within the same file. You need not have a separate file for each menu item. Just add additional methods into the Proxy class section, and additional context_menu.add_item calls into the context menu handler section.
    • Dan RathbunD

      [Code] wrapping operations

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      5
      0 Votes
      5 Posts
      2k Views
      M
      One can also wrap Dan's code in a method def self.operation(opName, procElse = nil, procEnsure = nil) if (block_given? && String === opName) am = Sketchup.active_model begin am.start_operation(opName, true) yield am.commit_operation rescue => e am.abort_operation puts("Error operation block #<#{e.class.name};#{e.message}.>") puts(e.backtrace) if $VERBOSE else procElse.call() if (Proc === procElse) ensure procEnsure.call() if (Proc === procEnsure) end else raise "Error operation parameters - No block given or opName not a String!" end end # call by # operation("My operation") { operation block } Note that if either procElse and procEnsure are used, they should probably be lambdas. One should also be careful about return statements in the block passed to the method. BTW, I'll use snake case for methods, maybe not variables... Greg
    • Dan RathbunD

      WebDialogBuilder class : brainstorming

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      13
      0 Votes
      13 Posts
      396 Views
      Dan RathbunD
      no problem.. These classes are kinda deprecated.. (unless you had to make up a custom control, perhaps an image button...) because nowadays most browsers render controls on a webpage using the native OS's control set. You can be sure this is done in MSIE (for older versions,) by including a <META> tag in the <HEAD> section, thus: %(#8000BF)[<META HTTP-EQUIV="MSThemeCompatible" CONTENT="Yes">] And you'll get XP style controls, instead of the old ugly gray Win 3.x style controls. The tag will be ignored on OSX, as Safari would use Apple style controls.
    • Dan RathbunD

      WebDialogs using Chrome : any interest ?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      25
      0 Votes
      25 Posts
      1k Views
      JD HillJ
      I'm very sure of that, and it was not my intention to imply otherwise. It just sounded like you were keeping that possibility open, so I felt the need to speak up. If it's your intention that it be strictly opt-in though, the idea sounds nothing but good to me.
    • Dan RathbunD

      [Info] Notepad++ : Tip, Tricks &amp; Plugins

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      14
      0 Votes
      14 Posts
      7k Views
      Dan RathbunD
      It's quite easy to customize your Right-Click Popup ContextMenu in Notepad++ For this example, we use the SessionManager Plugin by Mike Foster. (The plugin is now up to version 0.6 and works very well now. So update if you have an older version.) I have many project sessions saved, and now start Notepad++ with an empty session, and choose which project I will work on. There are two issues. (1) The "Plugins" menu is huge! And having to go through it to get to the "Session Manager" sub-menu, each time, is a bummer. (2) Even though the "Shortcut Mapper" is powerful, there is no way (that I can find,) to list those that have already been assigned. And a multitude have been! I do not know whether I will interfere with a shortcut that is already in use. So instead, I added a ContextMenu sub-menu: On the main menu: Settings > Edit Popup ContextMenu (Click the OK button to have NPP open your user contextMenu.xml file.) After the file opens, scroll down to the section beginning: <!-- To add plugin commands, ..... --> ... Add just below that comment (and above the lines adding "base64 encode" commands,) the following lines (if your running English and the actual "Session Manager" menu items are in English.): <Item FolderName="Session &Manager" PluginEntryName="Session Manager" PluginCommandItemName="Sessions..." /> <Item FolderName="Session &Manager" PluginEntryName="Session Manager" PluginCommandItemName="Settings..." /> <Item FolderName="Session &Manager" id="0"/> <Item FolderName="Session &Manager" PluginEntryName="Session Manager" PluginCommandItemName="Save current" /> Now.. restart NPP, and you will now have a "Session Manager" submenu on the right-click popup context menu. So launch a session: Right-Click, M, ENTER BUT.. say you do not like the author's menu item names (there are 3 that begin with "S" and Windows' built-in 'starting letter' menu accelerators will not work for items, that are on a menu where other items also begin with the same letter.) No problem ... the contextMenu.xml format allows you to use a different name (and accelerator letter,) than the plugin author used in his "Plugins" sub-menu. Add an ItemNameAs= attribute, to the Item tag. Say that you want the accelerator to be "S" for the "Session Manager" popup sub-menu, and rename the menu items, and specify what accelerator will fire them using &: (I also went up near the top of the file, and changed the accelerator for "Select All" to "A".) <Item FolderName="&Session Manager" PluginEntryName="Session Manager" PluginCommandItemName="Sessions..." ItemNameAs="&Control..."/> <Item FolderName="&Session Manager" PluginEntryName="Session Manager" PluginCommandItemName="Settings..." ItemNameAs="&Options..."/> <Item FolderName="&Session Manager" id="0"/> <Item FolderName="&Session Manager" PluginEntryName="Session Manager" PluginCommandItemName="Save current" ItemNameAs="&Save Current Session"/> <Item FolderName="&Session Manager" PluginEntryName="Session Manager" PluginCommandItemName="Help" ItemNameAs="&Help"/> <Item FolderName="&Session Manager" PluginEntryName="Session Manager" PluginCommandItemName="About..." ItemNameAs="&About..."/> [whoops... fixed the typos, so all the & in the same place.] So I open Notepad++, Right-Click, and press "S" then "C", and choose which of my sessions I will work on. And, on my machine, the context menu now looks like this: [image: VaoK_npp_popup_session_mgr_submenu.png] A last word: The attribute PluginEntryName must be the plugin sub-menu title, as it appears in your localized langauge. The same for the PluginCommandItemName, it must be the sub-menu item you wish to clone, exactly as it appears on the main Plugins > whateverPlugin sub-menu.
    • Dan RathbunD

      [Code] !autoload.rb loads &quot;!_autoload&quot; folders - v3.0.0

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      7
      0 Votes
      7 Posts
      2k Views
      Dan RathbunD
      @unknownuser said: Is the “.rb” extension really necessary when using for example “require (“sketchup.rb”)? The answer is not very simple. You should read the method dictionary for Kernel.require(), Kernel.load(), Sketchup.require() and Sketchup.load(). These methods act differently: depending on the arguments (absolute or relative paths) depending upon the Ruby version depending whether a file extension is given The require() methods push successful paths into the $LOADED_FEATURES array, but may not add the actual extension of the file that was loaded. (This could cause confusion later.) The overridden methods in the Sketchup module do not act exactly the same as the global Kernel methods. (return values and filenames in Exception messages.) We almost need a complicated decision tree with all the permutations... to decide when to use a extension and when not to. It is recommended NOT to use a file extension with the Sketchup module overrides. (This also helps in development, as the same loader script can load both rb and rbs files, after scrambling.) Also be aware that the SketchupExtension class uses these overides. This is really an issue for it own topic thread (and perhaps there already is one?)
    • Dan RathbunD

      [code] SketchupExtension and rbs rubies

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      10
      0 Votes
      10 Posts
      4k Views
      Dan RathbunD
      WARNING: This is an OLD topic thread. The SketchupExtension class has been revised (at least) twice since this topic was written.
    • 1 / 1