sketchucation logo sketchucation
    • Login
    1. Home
    2. jeemang
    3. Topics
    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
    J
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 8
    • Posts 20
    • Groups 1

    Topics

    • J

      Model refresh issues on Windows

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      226 Views
      Dan RathbunD
      Did you read ThomThom's: WebDialogs - The Lost Manual — R1 2009NOV09 specifically the section on "Async vs sync Communication"
    • J

      Resizing WebDialog windows

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      8
      0 Votes
      8 Posts
      1k Views
      J
      @thomthom said: Callbacks from WebDialog Javascript under OSX is asynchronous - so sending multiple callbacks rapidly will eat some of the messages. You'd have to have a messagepump system to verify each message is received by Ruby before sending a new callback from Javascript. Do you know if anyone has yet managed to build such a system? I searched around a little on the forums and all I could seem to find was stuff like this: http://forums.sketchucation.com/viewtopic.php?f=180&t=22698 The javascript code in the Dynamic Components folder shows what seems to be one half of such a system, and thus gives a bit of a starting point, but it would be nice to have something a little more substantial to start from...
    • J

      JSON in Ruby

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      48
      0 Votes
      48 Posts
      7k Views
      Dan RathbunD
      [quote="Myhand":31wco2xd]I see that %(#8000BF)[escape()] and %(#8000BF)[unescape()] are deprecated (in Javascript,) though, and that you are recommending to use [them] ***%(#BF4000)[ @unknownuser said: ]*** @unknownuser said: ](http://msdn.microsoft.com/en-us/library/dz4x90hk(v)":31wco2xd]The unescape function should not be used to decode Uniform Resource Identifiers (URI). Use decodeURI and decodeURIComponent functions instead. %(#8000BF)[decodeURI()] %(#8000BF)[decodeURIComponent()] Which do you recommend or should I continue with %(#8000BF)[unescape()]? The old functions are ASCII, the new ones are Unicode. Taking a look at the most recent released ECMA-262 (but not the latest proposed revision,) the old functions are no longer listed. see: ECMA-262, 5.1, Global Object: 15.1.3 URI Handling Function Properties ECMAScript Language Specification Standard ECMA-262 5.1 Edition / June 2011 Link to the downloadable PDF of the specification. But you need to handle the situation where an older browser does not have these functions so, write a wrapper in JS: var unesc = function(uri) { var test = false; if (typeof(decodeURI) == "function") test = true; return test ? decodeURI(uri) ; unescape(uri); }
    • J

      WebDialog.execute_script on OSX

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      2
      0 Votes
      2 Posts
      378 Views
      thomthomT
      I use the jQuery .ready() event that loads when the DOM is ready to make a callback back to Ruby. Then I can 100% sure I can use execute_script. Works on both platforms. No need for sleep or timers. I've made a few notes about WebDialogs: http://forums.sketchucation.com/viewtopic.php?f=180&t=23445
    • J

      Keep WebDialog in front on XP/Vista?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      10
      0 Votes
      10 Posts
      373 Views
      J
      Wowsers, thanks for all the responses. Question answered!
    • J

      How to detect internal browser usage?

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      4
      0 Votes
      4 Posts
      259 Views
      thomthomT
      Yes. I gave him a nudge in this direction.
    • J

      Can you store Entities as attributes?

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      12
      0 Votes
      12 Posts
      692 Views
      J
      Awesome -- just stuck that into my code and it seems to be working great. Many thanks to both of you for your help. Josh
    • J

      Optimize plugin code

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      6
      0 Votes
      6 Posts
      1k Views
      thomthomT
      For instance: iterating through a collection of entities and deleting some: Example - deleting faces. This is slow entities.each { |e| e.erase! if e.is_a?(Sketchup::Face) } This is faster: faces = [] entities.each { |e| faces << e if e.is_a?(Sketchup::Face) } entities.erase_entities(faces) Same goes for selection/deselecting. Anything where SU offers to do either per item or as an array of items - try to pass array of items.
    • 1 / 1