sketchucation logo sketchucation
    • Login
    1. Home
    2. slbaumgartner
    3. Posts
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    S
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 19
    • Posts 1,003
    • Groups 2

    Posts

    Recent Best Controversial
    • RE: New SketchUp Developers Tools - TestUp

      @driven said:

      I did wonder the same after cloning the new version and losing that fix, at the same time I added

      </body>
      >   <script> bodyLoad() </script>
      

      and deleted it the top tag, again.

      I'm away for a few days but will try your version hack, does it work with gems?
      john

      The only reason it wouldn't work with gems is that SketchUp doesn't set up a library load path to anything except their own stuff. To get any other ruby code you need either to copy it into SketchUp's area or manipulate the ruby load path before you access it.

      Steve

      posted in Developers' Forum
      S
      slbaumgartner
    • RE: New SketchUp Developers Tools - TestUp

      @unknownuser said:

      I suspect this is a Mountain Lion problem. Chris added to an issue over on the github site.

      Link Preview Image
      Console needs some style tweaks on the mac · Issue #1 · SketchUp/sketchup-developer-tools

      There are some inconsistencies on the mac. We need to update the CSS to fix the following: Hover on the top checkboxes is inconsistent. One is white and one is nothing. Also, those checkboxes and labels should have the same cursor (point...

      favicon

      GitHub (github.com)

      I'll buy a beer (or cookie) for whoever figures it out first. 😉

      Well, maybe I can claim the beer !

      There is a javascript bug in testup.html, at least on the Mac. The statement

      TESTUP_elements.gui.insertBefore(divNav, TESTUP_elements.gui.childNodes(0));

      throws an exception that causes createGUI to abort before it is finished, which is why the tabs never appear!
      At least on the Mac, childNodes is an array, not a function, and the correct syntax is:

      TESTUP_elements.gui.insertBefore(divNav, TESTUP_elements.gui.childNodes[0]);

      I still have the issue that John mentioned, the window is blank until the first time I right click. But all else is ok.
      I don't grok github yet, so if someone who does can post this as a suggested change, I'd be grateful.

      Steve

      P.S. I don't think it is relevant, but I also rewired SketchUp to use Ruby 1.8.7, per a note I posted on another thread.
      Also, out of sheer fussiness, I changed the test for @is_mac in testup.rb to
      @is_mac = (Object::RUBY_PLATFORM =~ /darwin/)!=nil
      since the original code returns 5 (the index of darwin in RUBY_PLATFORM) whereas @is_mac should be boolean.

      PPS - Oh, it seems the discussion moved to github and this issue has already been resolved there. 😳
      But that leaves me puzzled. If the fix has been known for a month or so, how come the code I got from GitHub still had all the old errors?

      posted in Developers' Forum
      S
      slbaumgartner
    • RE: Ruby Version for Sketchup 8.0 M1 on Mac ??

      @driven said:

      @dan rathbun said:

      I don't have a Mac.. but there must be a way for you guys to point that link at your up to date "system" Ruby.

      the path to version 8.5

      /Applications/Google\ SketchUp\ 8/SketchUp.app/Contents/Frameworks/Ruby.framework/Versions/A/Ruby

      but how to point it to system version??

      Not for the faint of heart, but here's how:

      • quit sketchup
      • open a terminal window
      • cd /Applications/Google\ SketchUp \8/SketchUp.app/Contents/Frameworks/Ruby.framework/Versions
      • sudo mv A A.orig
      • sudo ln -s /System/Library/Frameworks/Ruby.framework/Versions/1.8 A

      Restart SketchUp, open a Console window, and type VERSION. If all went well, it should report the same version as when you type ruby -e "puts VERSION" in a console window.

      To undo this hack, in the same Versions folder:

      • sudo rm A
      • sudo mv A.orig A
      posted in Developers' Forum
      S
      slbaumgartner
    • RE: (TRICK) To re-enable skp file preview

      @driven said:

      ~/.QL_SU/*.pv.png would be my first choice, that's probably best, no permision issues if I want to add titles etc... to the image or even add the image as the file icon with applescript.
      john

      OK, try the attached instead of the previous versions. ☀ I used ~/.QL_SketchUp just to be more explicit. Using these, your skp files can be scattered anywhere and the QuickLook should still work. Just remember. per my previous post, to delete the thumbnail if you delete the skp!

      Steve


      the QL generator


      the ruby plugin

      posted in SketchUp Tutorials
      S
      slbaumgartner
    • RE: (TRICK) To re-enable skp file preview

      @driven said:

      ~/.QL_SU/*.pv.png would be my first choice, that's probably best, no permision issues if I want to add titles etc... to the image or even add the image as the file icon with applescript.
      john

      Of course, there is a tradeoff: if the thumbnails are placed there, you can forget to delete one when you delete the associated skp file, causing abandoned thumbnails to accumulate in a hidden place that Finder doesn't normally show you.

      I'm trying this out. The Ruby part was easy, but I confess that the Objective-C part is forcing me to learn more about the Cocoa framework suite than I expected. It may take me a while 😉

      Steve

      posted in SketchUp Tutorials
      S
      slbaumgartner
    • RE: (TRICK) To re-enable skp file preview

      @driven said:

      @slbaumgartner said:

      Not sure I understand what you mean about the support folder - create some separate, fixed place where all the thumbnail images go instead of the same folder as the skp?

      Steve

      yes, could even be a dot files so it's hidden, point the QL generator at that... now I think of it some of my other QL have support folders with them, so you could install both at same time and place. completely separate from the ruby and the .skp
      john

      I get it now. I'll look into this. It will require revision of both the ruby and the QL plugin so that they look at the same folder, which will have to be in a well-known location so that it doesn't depend on how someone installed the generator (esp ~/Library vs /Library). Maybe a hidden folder in your home directory?

      Thanks
      Steve

      posted in SketchUp Tutorials
      S
      slbaumgartner
    • RE: (TRICK) To re-enable skp file preview

      @driven said:

      @slbaumgartner said:

      It creates an observer that causes SketchUp to save a jpeg image of the current view each time you save a file.

      You'll probably get some grief about using the ~/User/Library/ path, but I use both without issue, you just need to be careful that all supporting files/folders are in the same Folder for other plugins.
      however, I had to run from console the first time, for some reason, now it just works it.

      @unknownuser said:

      Second, I wrote a little QuickLook generator, also attached,
      Steve
      nice works well, but I'm also on ML...

      I'll have a play and see if there are any issues, other than moving the .skp without the .pv.jpg, maybe a support folder with the plugin?

      cheers
      john

      Hello,

      I have a habit of putting things into ~/Library born of times when I shared a system with others and I didn't want my tweakings to mess up theirs. Other than that, there is no reason you can't put these files into the /Library folders instead.

      You may have needed the console action to get the system to notice the generator. Other than qlmanage -r, I don't know what events cause it to check for new QuickLook generators.

      If you move the skp without the .pv.jpg you will lose the thumbnail and get a Trimble logo instead (nothing I did, it just happens) until you copy the image too or save the file again. Not sure I understand what you mean about the support folder - create some separate, fixed place where all the thumbnail images go instead of the same folder as the skp?

      Steve

      posted in SketchUp Tutorials
      S
      slbaumgartner
    • RE: (TRICK) To re-enable skp file preview

      @driven said:

      @geomp said:

      What's the best solution for Mac?

      check out Jeff's earlier post, GraphicConvertor.app is still the best solution I'm aware of...

      john

      As a new Mac convert, I was frustrated by the lack of QuickLook thumbnails for SketchUp files, and worse, on my Mac QuickLook tried to treat the file as text, taking a long time and then displaying a huge amount of useless hexadecimal data. So I decided to see if there was a simple solution. Here's what I came up with.

      First of all, although SketchUp saves a PNG format thumbnail inside each file (containing the last view you had open), and has Ruby API calls to generate thumbnails, these images are only 128 pixels wide. For a model of even modest complexity, this makes the image so distorted and blurry that it is useless. So, the first requirement was to create a better image for the file. To do this, I wrote the little Ruby plugin attached. It creates an observer that causes SketchUp to save a jpeg image of the current view each time you save a file. I set the image to 800x600 at a moderate level of compression to make it big and clear enough to see but not gigantic in size. You can easily edit the Ruby if you want a different size. The image has the same base name as the SketchUp file but with extension ".pv.jpg". There is a delay to export the image as you save a file; depending on the complexity of the model you might or might not notice.

      Second, I wrote a little QuickLook generator, also attached, that looks for the image to go with a SketchUp file and tells the system to use it as a thumbnail. SketchUp does not (at this time) register its own UTI for its files, so OS X creates a dynamic UTI for them. I put the dynamic UTIs for skp and skb files in the info.plist for this generator. I am led to believe that these should be the same on all Macs, so hopefully they will work for everyone. With this generator, the thumbnail image is displayed for any file that has one and the SketchUp icon for files that do not.

      To implement my system, copy the Ruby plugin into your plugins directory (~/Library/Application Support/Google SketchUp 8/SketchUp/Plugins) and copy the QuickLook generator into ~/Library/QuickLook. Note: by default the Finder hides your Library folder, but you can get there using the Go->Go To Folder menu in Finder. Also, you may need to restart the QuickLook system by rebooting or, if you are bolder, running qlmanage -r in a terminal window.

      Despite the name of the generator, it actually creates a thumbnail, not a preview. After working on this it struck me that given a well-detailed thumbnail, there was really no need for a preview. If you want to go beyond the thumbnail, you can just open the file in SketchUp.

      As I mentioned, I am new to Mac, so I don't know all the ins and outs of making this portable. I compiled the generator on a MacBook Pro under Mountain Lion, and I am not sure whether it will work on a non-Intel Mac or on an older version of the OS, as I have access to neither. If it won't run on your system, PM me and I'll be happy to send you the source code.

      Steve


      creates a jpeg image of the current view when you save a file


      uses the jpeg for a thumbnail in QuickLook

      posted in SketchUp Tutorials
      S
      slbaumgartner
    • RE: [Plugin] Angular Dimension

      @texasclodhopper said:

      I decide to finally try out this plugin with Sketchup v8 on my Mac. I used the Preferences/Extentions/Install Extension... method after renaming the ZIP file extension to RBZ. The files were installed as stated in a previous post here called "The most common reason that plugins don't work..." with a slight variation that doesn't allow the plugin to work.

      The version that I downloaded was for the Mac and was called "draw_angle_dim_Mac". The above extensions installer within Sketchup v8 installed the plugin correctly but one folder level too deep. The installation folder was named the same as the ZIP file "draw_angle_dim_Mac".

      You have to move the Ruby script "draw_angle_dim.rb" and the folder "draw_angle_dim" up one level for the plugin to work in Sketchup. Get rid of the folder "draw_angle_dim_Mac".

      I don't have a Mac, so I can't check the required paths there (the mac archive was assembled by driven), but what you say is consistent with how it works on a PC.

      posted in Plugins
      S
      slbaumgartner
    • RE: Using Unit Test with SketchUp for Debugging &amp; Testing

      Joe,

      Thanks for posting this. I was going to eventually, but got tangled up in other things and didn't get around to it/ I hope it is useful to others.

      Steve

      posted in Developers' Forum
      S
      slbaumgartner
    • [Plugin] Dimension management tools

      The two tools in this file facilitate the workflow recommended by many SketchUp experts: Begin by drawing the complete model without dimensions or annotations. Place all primitive entities on Layer0 and move Groups and Components to other layers when necessary to control visibility. When the model is complete, create scenes/pages with the model oriented so that critical features can be dimensioned visibly and draw dimensions, text, and angular dimensions again all on Layer0. Finally,move the dimension entities to a layer specific to the scene(s) on which they can be displayed legibly and without being clutter.

      The first tool, "Select all Dimensions" activates the Select tool, clears it, and adds all currently visible linear dimensions, Texts, and Groups with names matching "Angular Dimension" to the selection. This prepares you to manipulate all the dimensions in bulk, e.g. to assign a font or layer.

      The second tool, "Dimensions to Layer", prompts the user to select an existing layer or create a new layer. If a new layer is requested, it is made hidden on all scenes except the current one. All currently visible linear dimensions, Texts, and Groups with names matching "Angular Dimension" are moved to the selected layer.


      dimension_utilities.rb

      posted in Plugins
      S
      slbaumgartner
    • RE: [Plugin] Angular Dimension

      How strange! The key feature seems to be the assignment of nil before assignment of the new cursor. I can't imagine why that would be necessary, but if it works...

      posted in Plugins
      S
      slbaumgartner
    • RE: [Plugin] Angular Dimension

      @driven said:

      @slbaumgartner said:

      Alt key opening a menu is a standard PC shortcut -

      thought you were taking mac...

      @unknownuser said:

      Interestingly, ALT seems to affect just about every tool except move,
      it should 'move' a copy [with an added + symbol]

      @unknownuser said:

      You gotta love consistency and portability!
      ohhh yerrr

      @unknownuser said:

      Regarding the cursors, is there any chance that the problem is with png files? Do you have other tools with custom cursors from png files that work?

      All of SU's cursors are png's so that's not the problem.

      I want them to work now because I made new ones.... damm
      didn't really need the cursor before.

      john

      I'm on a PC but trying to help get this tool to work for people with Macs...
      On a PC, the CTRL key toggles the move tool to copy, not ALT!
      Re the cursors, do you have any examples of a tool with custom cursors that do work? I'd like to look at the Ruby to see what it does. I thought I was following the documented code...

      steve

      posted in Plugins
      S
      slbaumgartner
    • RE: [Plugin] Angular Dimension

      @driven said:

      @slbaumgartner said:

      the VK_ALT activates the File menu!

      Have you set that as a system shortcut?... do you have assistive devices activated?

      Does Alt open the File Menu when you use 'move' or 'scale' tools?

      are your Plugins still all on? [I turn mine off to test new rubies on there own]

      john

      EDIT: did you try **524288** that work here as well.

      Alt key opening a menu is a standard PC shortcut - I didn't do anything special, no assistive devices. Interestingly, ALT seems to affect just about every tool except move, on which it does nothing that I can see! And with the Paint Bucket it displays a dropper icon to let you select a Material to match so long as you hold the ALT key depressed. Goes back to the paint bucket when released. You gotta love consistency and portability!

      I didn't turn off other plugins, but on my PC the tool functions ok so I didn't think that would add anything to this mix.

      Regarding the cursors, is there any chance that the problem is with png files? Do you have other tools with custom cursors from png files that work?

      posted in Plugins
      S
      slbaumgartner
    • RE: [Plugin] Angular Dimension

      The mode key seems to be a no-win situation! Maybe I should think of a different mechanism to change the mode. On a PC the TAB key is unassigned, but the VK_ALT activates the File menu! On a Mac, the TAB key is preassigned, but not VK_ALT! By the way, when I try to use VK_ALT on the PC, the cursor alternately disappears and reappears as I press the key! Something similar may be what is happening on the Mac.

      posted in Plugins
      S
      slbaumgartner
    • RE: [Plugin] Angular Dimension

      I have to admit that I am lost and without a Mac I don't know what else to suggest...sorry! If anyone else can figure this out, I'd love to hear.

      posted in Plugins
      S
      slbaumgartner
    • RE: [Plugin] Angular Dimension

      @driven said:

      > load('/Library/Application Support/Google SketchUp 8/SketchUp/plugins/draw_angle_dim.rb')
      > true
      > > @cursor
      > nil
      > > DrawAngleDimTool;;IN_CURSOR
      > 50013
      > > DrawAngleDimTool;;OUT_CURSOR
      > 50014
      

      No cursor, no outside dims
      Pressing Tab just strobes the 'Input Box'

      john

      The responses to IN_CURSOR and OUT_CURSOR say that the cursors were created, though I'm not sure that means they found the image files. The response of nil to @cursor indicates nothing, since @cursor is an instance variable not a global. So, the problem still seems to be that the keypress is not toggling the mode to outside. Please try the attached, which looks for the up key event (will not trigger until tab key is released) and let me know if it works.


      draw_angle_dim.rb

      posted in Plugins
      S
      slbaumgartner
    • RE: [Plugin] Angular Dimension

      @driven said:

      Hi,

      on closer inspection, everything seems fine? except the onKeyDown. EDIT: swapped from Tab to Esc and I still can't get outside dims or cursors

      very few ' onKeyDown' work on macs. here's a list from today.

      PLATFORM = i686-darwin8.10.1

      SEQUENCE 0 of 5 [Function Keys]
      DN F2 Key 50 flags 0 rpt 1
      UP F2 Key 50 flags 256 rpt 1
      DN F3 Key 51 flags 0 rpt 1
      UP F3 Key 51 flags 256 rpt 1
      DN F6 Key 54 flags 0 rpt 1
      UP F6 Key 54 flags 256 rpt 1
      DN F12 Key 63243 flags 0 rpt 1
      UP F12 Key 63243 flags 8388864 rpt 1

      SEQUENCE 1 of 5 [Modifiers Keys]
      DN Shift alone Key 131072 flags 131330 rpt 1
      UP Shift alone Key 131072 flags 256 rpt 1
      DN Ctrl alone Key 262144 flags 262401 rpt 1
      UP Ctrl alone Key 262144 flags 256 rpt 1
      DN Alt alone Key 524288 flags 524576 rpt 1
      UP Alt alone Key 524288 flags 256 rpt 1
      DN Cmd alone Key 1048576 flags 1048840 rpt 1
      UP Cmd alone Key 1048576 flags 256 rpt 1

      SEQUENCE 2 of 5 [Arrow Keys]
      UP UP Key 63232 flags 10486016 rpt 1
      UP RIGHT Key 63235 flags 10486016 rpt 1
      UP DOWN Key 63233 flags 10486016 rpt 1
      UP LEFT Key 63234 flags 10486016 rpt 1

      SEQUENCE 3 of 5 [Validation Keys]
      DN RETURN Key 13 flags 0 rpt 1
      UP RETURN Key 13 flags 256 rpt 1
      UP TAB Key 9 flags 256 rpt 1
      UP DEL Key 127 flags 256 rpt 1
      UP BACKSPACE Key 63272 flags 8388864 rpt 1
      DN ESCAPE Key 27 flags 0 rpt 1
      UP ESCAPE Key 27 flags 256 rpt 1

      SEQUENCE 4 of 5 [Numbers Keys (Numpad not common)]
      UP 1 Key 49 flags 256 rpt 1
      UP 2 Key 50 flags 256 rpt 1
      UP 3 Key 51 flags 256 rpt 1
      UP 4 Key 52 flags 256 rpt 1
      UP 5 Key 53 flags 256 rpt 1
      UP 6 Key 54 flags 256 rpt 1
      UP 7 Key 55 flags 256 rpt 1
      UP 8 Key 56 flags 256 rpt 1
      UP 9 Key 57 flags 256 rpt 1
      UP 0 Key 48 flags 256 rpt 1
      UP - Key 45 flags 256 rpt 1
      UP = Key 61 flags 256 rpt 1
      UP / Key 47 flags 256 rpt 1
      UP [ Key 91 flags 256 rpt 1
      UP ] Key 93 flags 256 rpt 1

      SEQUENCE 5 of 5 [Alpha keys (do not use Shift)]
      UP s Key 115 flags 256 rpt 1
      UP c Key 99 flags 256 rpt 1
      UP r Key 114 flags 256 rpt 1

      complements of a Fredo script c.2007 with a slight update.
      john

      Based on this, it looks like maybe it would work if you rename onKeyDown to onKeyUp, as it looks like the up is reported for TAB as key 9. Could you try that and let me know if it works?

      Thanks
      Steve

      posted in Plugins
      S
      slbaumgartner
    • RE: [Plugin] Angular Dimension

      @driven said:

      Hi,
      I just read your script and your cursors use all UPPERCASE which was actually failing gracefully, ie. '@cursor' not defined, but the tool still works.

      I had a look at your cursor images and see that they had never appeared. I'm getting the 'snap to' squares...

      I'll downcase the cursor names and see if that works, but I suspect 'Tab' key will be an issue on mac.

      john

      That seems unlikely...all uppercase is pretty typical convention for constants in Ruby, and should have nothing to do with Mac vs PC. If you are finding @cursor not defined, that seems more likely a problem with the path to the icon files. Are they installed in Plugins/draw_dim_angle?

      Try this: open the Ruby Console window and type DrawAngleDimTool::IN_ICON into the input space. The output space should then display the path for interior.png. If the path is mangled or isn't where you installed the png image, that is the problem. You can also type DrawAngleDimTool::IN_CURSOR and you should get a number back, probably somewhere a bit more than 50000. If that doesn't work, SketchUp failed to load the image file.

      If you look at onKeyDown, there is a code snippet to print the keycode you get on the Mac. Please let me know what value you get and I'll see if I can code in a trap for PC vs Mac.

      posted in Plugins
      S
      slbaumgartner
    • RE: [Plugin] Angular Dimension

      @driven said:

      hi,

      it's holding on to the 'Orbit' or 'Pan' cursor if I use either between angles.

      it's own cursor comes back and functions, but is hidden behind the hand.

      I'm on a mac

      otherwise it appears to be working, well done. no error messages...

      john

      Hmmm...it doesn't do that on my PC. I don't have a Mac to test on. Maybe someone in the group who has a Mac can help sort this out?

      posted in Plugins
      S
      slbaumgartner
    • 1 / 1