sketchucation logo sketchucation
    • Login
    1. Home
    2. Pout
    3. Posts
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download
    P
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 57
    • Posts 259
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: SU Ruby + XML

      So you import the xml file into the webdialog and in there you parse it? With a javascript script or something else?
      I'm getting lost here.

      posted in Developers' Forum
      P
      Pout
    • RE: [Plugin] Repeat Copy UPDATED 2-24-2010

      Thx !

      posted in Plugins
      P
      Pout
    • RE: [Plugin] SketchUp Animation using mover.rb

      @unknownuser said:

      Has anyone played with this plug-in more? I can set the scenes so that elements move properly between scenes, but when I export as avi nothing moves. Does the plug-in not support exporting, or is there something else I should be doing? Would a different animation plug-in work better?

      This is a know problem with sketchup animation.
      All none-sketchup scripts are neglected in the creation of the animation.

      posted in Plugins
      P
      Pout
    • RE: [Plugin] Repeat Copy UPDATED 2-24-2010

      Hey Chris,

      Great plugin! A multicopy function πŸ˜„

      What i was wondering: how did you create that interface?
      Was it with add_note?

      posted in Plugins
      P
      Pout
    • RE: SU Ruby + XML

      and? did you manage to get something working that could parse xml?

      posted in Developers' Forum
      P
      Pout
    • RE: Escape characters between ruby and javascript

      Thx all. I managed to get it working

      posted in Developers' Forum
      P
      Pout
    • RE: Escape characters between ruby and javascript

      Thomas,

      When I use your suggestion it does not seem to work
      escape in javascript indeed give me %c2
      but the p value in the callback still contains , in the strings

      example

      x="abc";
      y="1,2,3";
      z="1,23";
      x=escape(x);
      y=escape(y);
      z=escape(z);
      settings=x+","+y+","+z;
      alert (settings); -->abc,1%c22%c23,1%c223
      query = 'skp;_edit@'+settings;
      window.location.href = query;
      
      window.add_action_callback("_edit") {|window,p|
      puts p -->abc,1,2,3,1,223
      
      posted in Developers' Forum
      P
      Pout
    • RE: Escape characters between ruby and javascript

      Thx Thomas and Tod.

      Tod,
      What would be the most correct way then to split the settings string again in ruby?

      I had another idea, dunno if it is a descent one:

      If i replace every possible problem character with a code eg.
      ,--><c0mm4>
      '--><qu0t3>
      "--><2qu0t3>

      And this at both the javascript as the ruby side (and re-encode them if necessary).
      Chances of having that exact value in a string are close to nil I think.

      Would this be a good and solid solution, or just a workarround for dummies?

      posted in Developers' Forum
      P
      Pout
    • Escape characters between ruby and javascript

      i have a javascript like this:

      settings=x+","+y+","+z;
      query = 'skp;_edit@'+settings;
      window.location.href = query;
      

      in ruby:

      window.add_action_callback("_edit") {|window,p|
      resultarray=p.split(",")
      

      Now the x, y or z value in javascript can contain commas.
      So this will cause problems for the resultarray in ruby.
      What is the best way to escape the comma's (or any problem characters in javascript) so they are comming to ruby in a usable way?

      Off course the other way arround is also a problem:
      ruby

      rubyarray=['blablabla,','boem,boem,boem','world']
      #join the array to send to javascript
      rubyarray=rubyarray.compact.join(",")
      command = "_test('#{rubyarray}')"
      window.execute_script(command)
      

      In javascriptI split up the string by comma

      function _test(x)
      p = x.split(',');
      

      This again gives me to much elements. How do i escape the unneccesary comma's in the ruby string?

      Thx!

      posted in Developers' Forum
      P
      Pout
    • RE: WebDialogs - The Lost Manual β€” R1 09 November 2009

      this seems to be very interesting
      Have to dig into this.

      posted in Developers' Forum
      P
      Pout
    • RE: Get_element value for checkbox

      or maybe like this

      1. ruby
      command = "_getcheckboxvalue()"
      webdialog.execute_script(command)
      
      1. javascript
      function _getcheckboxvalue(){
      //get the checkboxvalue
      thevalue=document.getElementById('test').value;
      //send it back to ruby
      query = 'skp;_sendcheckboxvalue@'+thevalue;
      window.location.href = query;
      }
      

      3.ruby

      webdialog.add_action_callback("_sendcheckboxvalue") {|webdialog,p|
      //p=the checkbox value
      //do something
      }
      

      (untested)

      posted in Developers' Forum
      P
      Pout
    • RE: Sketchup AutoCAD-like command

      I'll have a look into it.
      Btw, to insert a second point, is it mandatory to first click to box in which you insert the coordinates? Or can you just type it?

      posted in Developers' Forum
      P
      Pout
    • RE: Sketchup AutoCAD-like command

      thx dedmin!
      App. also possible when moving objects.

      posted in Developers' Forum
      P
      Pout
    • Sketchup AutoCAD-like command

      Sometimes i feel the lack of some commands while drawing in SU (or i lack the correct knowladge to draw them)

      Some functionalities in AutoCAD for drawing look interesting to me.
      For example:
      Define start point of a line by inserting the xyz coordinates
      Define end point of a line by inserting XYZ coordinates (possibly relative to the previous point)
      Move an object into a certain direction by an certain amount (possibly relative to the selected point)

      I don't know if there are functions for this or if anyone already wrote something like this.
      If not, i'll have a look into it (that is, if there are no standard SU functions for this)

      posted in Developers' Forum
      P
      Pout
    • RE: Toolbar Registry Hacks

      I'm sometimes incredibly amazed by the knowledge and search capabilities of some developers here.
      Great job! πŸ‘

      posted in Developers' Forum
      P
      Pout
    • RE: Create toolbar on the fly

      "crawls in a corner in shame"

      Thx! sometimes I can just hit myself

      posted in Developers' Forum
      P
      Pout
    • Create toolbar on the fly

      I'm I correct: it is not possible to create a toolbar from in the ruby console using these command?

      toolbar = UI::Toolbar.new "testtoolbar"
      cmd = UI::Command.new("testbutton") {a function }
      cmd.small_icon = "testimage.png"
      cmd.large_icon = "testimage.png"
      cmd.tooltip = ("testfunction")
      cmd.status_bar_text = ("execute testfunction")
      cmd.menu_text = ("execute testfunction")
      toolbar = toolbar.add_item cmd

      The toolbar is created and listed in the toolbars overview but it is not shown.

      posted in Developers' Forum
      P
      Pout
    • Load script in script

      situation

      I have a full script that has been defined by modules and def's

      Now, I only want it to be loaded when certain parametres are ok.

      The 2 solutions I came up with is this:

      • Make 2 rb's: rb1 who checks the parametres, if they are ok, then load the full script from rb2.
        Problem is rb2 contains data i need in rb1. I can not put that data in rb1 (since it is version information I want to keep in rb2)

      • keep all in 1 rb (put the complete script rb2 in a module/def)
        That does not work: not possible to put the modules and defs of rb2 in a module

      Are there any other ways to solve this?

      posted in Developers' Forum
      P
      Pout
    • RE: [Plugin] Unhide ALL (Edges) - Inside Groups / Components ???

      @jim said:

      Is the fix posted in this thread still needed for the latest SketchUp versions?

      i just did the test, and yes it is still needed

      posted in Plugins
      P
      Pout
    • RE: Get one specific entity out of all entities: method?

      @thomthom said:

      A separate entity ID system using attribute dictionaries?

      This whole entity ID is a pain. When I was working on DoubleCut, trying to pair up two components I was trying all kinds of methods to keep track of the entities. Outright pain and suffering! 😞

      Indeed, a unique entity id is created by the plugin and stored in the attribute dictionary of that entity.
      Seems to be the only good and controlable way to identify Sketchup objects.

      Did you use the same method for your problem or did you find a work-arround?

      posted in Developers' Forum
      P
      Pout
    • 1 / 1