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.
Posts made by Pout
-
RE: SU Ruby + XML
-
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. -
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? -
RE: SU Ruby + XML
and? did you manage to get something working that could parse xml?
-
RE: Escape characters between ruby and javascript
Thx all. I managed to get it working
-
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 stringsexample
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
-
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?
-
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:
rubyrubyarray=['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!
-
RE: WebDialogs - The Lost Manual β R1 09 November 2009
this seems to be very interesting
Have to dig into this. -
RE: Get_element value for checkbox
or maybe like this
- ruby
command = "_getcheckboxvalue()" webdialog.execute_script(command)
- 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)
-
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? -
RE: Sketchup AutoCAD-like command
thx dedmin!
App. also possible when moving objects. -
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) -
RE: Toolbar Registry Hacks
I'm sometimes incredibly amazed by the knowledge and search capabilities of some developers here.
Great job! -
RE: Create toolbar on the fly
"crawls in a corner in shame"
Thx! sometimes I can just hit myself
-
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 cmdThe toolbar is created and listed in the toolbars overview but it is not shown.
-
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?
-
-
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
-
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?