sketchucation logo sketchucation
    • Login
    1. Home
    2. alexschreyer
    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!
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 23
    • Posts 146
    • Groups 2

    Posts

    Recent Best Controversial
    • RE: [plugin] Ruby Code Editor - UPDATED to v3.0 3/4/2013

      @Dan: I can do that the next time. I did put a note on the last thread mentioning that there is an update available at the same address. And the last thread went a little off-topic after a while, so I thought this would keep things clean.

      The main download location is still my website, so at least there are no old versions floating around.

      Cheers, Alex

      P.S. WebKit doesn't seem to want to save cookies from a local page somehow, so I might have to do a local preference storage (as suggested before) after all...

      posted in Plugins
      alexschreyerA
      alexschreyer
    • RE: [plugin] Ruby Code Editor - UPDATED to v3.0 3/4/2013

      @driven said:

      I have to right click to get to the drop down box, then click load link

      Yuck! That is indeed a glitch. It is only happening in Safari/Chrome. So for now that's a problem only for mac users. I'll fix that later today. Thanks for letting me know.

      Cheers,
      Alex

      posted in Plugins
      alexschreyerA
      alexschreyer
    • RE: [plugin] Ruby Code Editor - UPDATED to v3.0 3/4/2013

      @driven said:

      I always get the open link format on restart even after setting options

      Not sure what you mean by this. I have to admit that I haven't tried either version on a mac yet. I'll do that soon but in the meantime keep any bugs coming my way...

      Cheers,
      Alex

      posted in Plugins
      alexschreyerA
      alexschreyer
    • [plugin] Ruby Code Editor - UPDATED to v3.0 3/4/2013

      Hi All,

      Please see my other forum post for details and all updates:

      http://sketchucation.com/forums/viewtopic.php?f=323&t=25800

      Cheers,
      Alex

      posted in Plugins
      alexschreyerA
      alexschreyer
    • RE: Alternate API, Pioneers Wanted

      Martin, I finally looked a little longer at your website and I saw your approach to geometry creation. That's exactly what I meant earlier. SketchUp needed an approach to geometry creation that was not targeted at coders but rather at users. Very well done.

      Thanks also for your e-book. One small suggestion: I have a wide-screen monitor and html pages without width limit always become hard to read because of long lines. It might be a good idea to apply a "max-width" statement at least to the body element and target a width of 960px (also for all images).

      In any case - thanks so much for putting this together.

      posted in Developers' Forum
      alexschreyerA
      alexschreyer
    • RE: Alternate API, Pioneers Wanted

      Great approach, ultimately there should be easy accessible methods for geometry creation, too (e.g. new box, new pyramid etc.)

      Cheers,
      Alex

      posted in Developers' Forum
      alexschreyerA
      alexschreyer
    • RE: [plugin] Ruby Code Editor - UPDATED to v3.0 3/4/2013

      Thanks for the recommendations, guys. I actually went with the easiest version (cookies) for now since I was able to implement this without hassle. I'll look at file storage later.

      Didn't know that the registry could actually become too large. I never ran into this problem. And I have several Autodesk products installed (those are huuuge - though mostly by filesize! When will ADSK finally cut down on bloating their own software).

      Cheers,
      Alex

      posted in Plugins
      alexschreyerA
      alexschreyer
    • RE: [plugin] Ruby Code Editor - UPDATED to v3.0 3/4/2013

      @Dan: You are right, going with the OS styling also makes sense to keep elements looking "native" on Win and Mac.

      I wanted to go with the jQuery UI framework, though, so that a) the dialog looks exactly the same on Win and Mac and b) later I could offer different styling to users, so that they can pick their preference from a dropdown. The UI system has various nice templates:

      Link Preview Image
      ThemeRoller | jQuery UI

      jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. Whether you're building highly interactive web applications or you just need to add a date picker to a form control, jQuery UI is the perfect choice.

      favicon

      (jqueryui.com)

      One question: I have to save some preferences (like the UI selection) locally. Can I reliably use cookies or should I go with an ini file?

      Cheers,
      Alex

      posted in Plugins
      alexschreyerA
      alexschreyer
    • RE: [plugin] Ruby Code Editor - UPDATED to v3.0 3/4/2013

      @chrisglasier: I see now where you are coming from. My idea with my revision of Jim's Web Console was to make it more functional and spruce up the visuals but keep it easy enough for the beginning coder. I'll look again at your approach with the namesets but it seemed to me at the time to complicate things. I guess I just don't fully understand it yet.

      I am all for collaboration and combining efforts, though.

      Cheers,
      Alex

      posted in Plugins
      alexschreyerA
      alexschreyer
    • RE: [plugin] Ruby Code Editor - UPDATED to v3.0 3/4/2013

      I'll change the dialog name. Must have overlooked that one. I changed the class name.

      In the meantime, I figured out how to get linebreaks from a file into a dialog.

      filename = UI.openpanel
      f = File.new(filename,"r")
      text = f.readlines.join.gsub!(/\n/, '<KghBr31sD>')
      
      ndlg = UI;;WebDialog.new("Ruby Web Console", true, "WebCon123", 600, 400, 100, 100, true)
      ndlg.set_html ("<html><head></head><body><textarea style='width;100%;height;100%' name='mybox' id='mybox'></textarea></body></html>")
      ndlg.show {
        ndlg.execute_script("var text = '#{text}';var asddsa = text.replace(/<KghBr31sD>/g,String.fromCharCode(13));document.getElementById('mybox').value = asddsa")
      }
      

      I think I saw the method (i.e. using a gibberish tag) discussed recently in the developers forum. I'll give that a try soon.

      Cheers,
      Alex

      posted in Plugins
      alexschreyerA
      alexschreyer
    • RE: [plugin] Ruby Code Editor - UPDATED to v3.0 3/4/2013

      Thanks, Dan, for going through this so thoroughly. Everyone, please feel free to suggest code improvements. I would like to make this as useful as possible. Of course, I'll mention every help on the "About" tab.

      @Dan: I'll incorporate your revisions into the output code. That is really the part here that I had looked at the least.

      I like the idea of having tabbed multiple files. With the current tab support that should be relatively easy to implement.

      And thanks for the hint on the Windows UI look for IE. I didn't even know about the tag.

      Cheers,
      Alex

      posted in Plugins
      alexschreyerA
      alexschreyer
    • RE: [plugin] Ruby Code Editor - UPDATED to v3.0 3/4/2013

      Thanks for the feedback, everybody! Keep it coming...

      @Chris Fullmer: Looking at the result capture code, it appears to convert characters such as the newline into HTML characters before sending it to the dialog. I tried to find a way around this - to no avail. Sending a newline \n to the execute_script doesn't work for me. Apparently that's why Jim put these conversions in there. I'll try later if there is an easier way to "encode" these before sending and "decode" them in Javascript in the dialog.

      @chrisglasier: I remember your nameset approach from earlier. It can very well work with my editor. At some point, it would be great to have a code completion available, which could be your method. I am thinking of the user placing the caret, then clicking a key combination and then having a window pop up (like yours), where the method can be selected. How is your window implemented? I can easily incorporate something that resides in a DIV with Javascript.

      Cheers,
      Alex

      posted in Plugins
      alexschreyerA
      alexschreyer
    • RE: [plugin] Ruby Code Editor - UPDATED to v3.0 3/4/2013

      @thomthom: The bottom of the page disappears when the window width gets so small that the file name breaks into the next row. I wanted to keep the layout fluid so that elements adjust on resize, but maybe I can find a better way to arrange the page more reliably.

      Not sure why there is no output. I didn't touch Jim's code that deals with capturing the Ruby response - does this also happen with the original Web Console?

      Cheers, Alex

      posted in Plugins
      alexschreyerA
      alexschreyer
    • [plugin] Ruby Code Editor - UPDATED to v3.0 3/4/2013

      Hi All,

      http://www.alexschreyer.net/blog/wp-content/uploads/2010/02/sketchup-ruby-editor-1-530x302.jpg

      EDIT (3/4/2013): This plugin has been updated to version 3.0. The plugin got a major update! Some of the new features are: better environment stability (editor, scrolling, results, etc.), code completion for SketchUp classes and methods and a variety of other minor updates.

      This code editor plugin offers an easy-to-use and visually appealing way to create and modify Ruby scripts directly within SketchUp. These scripts can then be used to create geometry, add functionality or add data within the SketchUp 3D modeling environment. The SketchUp Ruby API provides an extensive set of functions to automatize SketchUp in many ways or create scripted, computational geometry.

      I created this editor mainly for two reasons: One is that when I write code, I permanently need to look up documentation. To make this easier, I added a bunch of reference webpages to a browser in a tab. Also, a dropdown above the editor contains some common code snippets that can be inserted at the current cursor position. Version 3.0 also introduces a code-completion feature that you can invoke at any point by clicking CTRL-SHIFT. It contains SketchUp’s classes and methods.

      The other reason I wrote this as a plugin that works right inside of SketchUp is that I wanted it to give easy access to the Ruby coding environment and behave a bit more like a real code editor. To accomplish this, I added a bit of jQuery magic to make it look good and have some additional features. I also added the excellent CodeMirror 3.1 syntax highlighting engine. This provides the editor with multi-language code highlighting, correct TAB control, bracket matching and many more features. Just load the plugin and give it a try to see for yourself!

      The following video gives a brief overview of the current version:

      You can get this editor from my website (and see a changelog) at:
      http://www.alexschreyer.net/projects/sketchup-ruby-code-editor/

      For more on what you can do with it, check out my book "Architectural Design with SketchUp" (especially chapter 6):

      Link Preview Image
      SketchUp for Design

      Tutorials and news about architectural design, 3D modeling, rendering, drawing, extensions/plugins, making, and scripting with Trimble's SketchUp and LayOut.

      favicon

      SketchUp for Design (sketchupfordesign.com)

      Cheers,
      Alex

      posted in Plugins
      alexschreyerA
      alexschreyer
    • AutoCAD gets facets

      I just got an email announcing an AutoCAD plugin for faceted curves. This is a funny reversal if one considers that "perfect" curves were on the SketchUp wish list for a while...

      http://labs.autodesk.com/utilities/ADN_plugins/

      Cheers,
      Alex

      posted in SketchUp Discussions sketchup
      alexschreyerA
      alexschreyer
    • RE: Waterproofing Wood/ making water tank out of wood?

      Don't forget that water pressure increases toward the bottom. Although this is not very deep, make sure that the wall/floor joint is tight. I would also add fillers (e.g. 2x2) into all inside corners and then screw the boards to them. That makes tighter corners and provides stability.

      Also, don't be tempted to buy OSB (as shown on one of your images) unless you completely cover it.

      posted in Newbie Forum
      alexschreyerA
      alexschreyer
    • RE: [WebDialog]Behind nset Sketchup API

      Well done, Chris (and Jim)! This is a very nice in-SketchUp Ruby reference.

      Cheers, Alex

      posted in Developers' Forum
      alexschreyerA
      alexschreyer
    • RE: SU Ruby Cheat-sheet

      Looks great!

      Cheers,
      Alex

      posted in Developers' Forum
      alexschreyerA
      alexschreyer
    • RE: SU Ruby Cheat-sheet

      Here ya go. This file is the 7.0 list, so you'll have to add the new functions.

      Cheers,
      Alex


      sketchup_ruby_functions.txt

      posted in Developers' Forum
      alexschreyerA
      alexschreyer
    • RE: SU Ruby Cheat-sheet

      Great to hear you want to try this out. I'll post a text file with the entire list later today.

      Cheers, Alex

      posted in Developers' Forum
      alexschreyerA
      alexschreyer
    • 1 / 1