Do you have the dialog sketched? Is there a fixed dialog or does it vary depending on the model? An HTML form would go a long way here.
Posts
-
RE: Help and contribution needed. Thank you.
-
RE: Stretching with an offset + stretching on all sides
@agamemnus said:
I was afraid of this. I know about everything you just mentioned but I was hoping I had missed some little-known shortcut. I guess not.
Some of these problems have simple Ruby Console solutions. I'm not sure I understand what you were doing, tho. Would a picture be possible?
-
RE: Layering in animation
@emy said:
How can I solve this problem? Thanks for your help.
Can you describe "this problem" in a way that's entirely related to what you want to achieve and unrelated to SketchUp layers? I'm not sure that SketchUp layers are the tool you want to be using.
-
RE: Ruby :symbols
@thomthom said:
What is off target and plain wrong?
A question I can't answer until I can answer my own question: What's a symbol?
The link was a good one but after a too-quick read I was better versed in what you could do with symbols that what a symbol was.
In most languages there is a symbol table, under the covers. Ruby symbols seem to be bringing this capability forward, allowing us to add to the table in some way that I'm not sure I understand. Edit: make that "in some way I'm sure I don't understand." end edit
Nagging questions: if "foo" is a variable name it will be in the symbol table and :foo will be a symbol. What about "foo.bar"? Is that a :foo plus a :bar, or is it :foo.bar?
-
RE: Alternate API, Pioneers Wanted
@chrisglasier said:
Please let me know how you think.
I just finished the first draft of the last chapter. With luck I'm close to completing the project, tho a correspondent just provided a compellingly good idea ...
Going to get back to multi-object animation in a week or three.
-
Ruby :symbols
I have googled and read much on the subject of :symbols in Ruby. I strongly suspect that most of what I have read is off target, if not just plain wrong. There is some strong relationship between names in a Ruby program, and symbols, but I don't know exactly what.
Enlightenment?
-
RE: C != C
@chris fullmer said:
What does it return is the question? I don't know how to run js snippets.
My JavaScript Console runs JS, rather like Jim's WebConsole runs Ruby. Chapter 17, Reference Resources includes it, fourth tab.
The next two chapters will get you started WebDialoging, even if you know no HTML, CSS or JavaScript. Chapter 16 has a fairy tale. You might be in it.
Here's a minimal snippet tester:
<html><body><script> alert( 'put your snippet here' ) </script></body></html>Save it as
whatever.htmland open it in your favorite browser. (Notepad++ is much smarter about HTML and JavaScript than it is about Ruby.) -
RE: Timer < 1.0 seconds ?
TT Watch Airshow!.
It implements the Animation interface, then calls
show_frame(). Every hundred frames (about 24/sec.) it compares time elapsed to frames elapsed and adjust the delay up or down. Runs pretty close to 24 fps.All explained in Chapter 16, Professional Animation. You might enjoy the fairy tale.
-
RE: Alternate API, Pioneers Wanted
@chrisglasier said:
The multiplicity of objects is important to me ...
My Transformation-free API is not an animation controller. Being able to say
movable.move()is just a lot more convenient than doing all the underware steps yourself.It makes moving elevators, for example, very easy. But it doesn't solve any of the problems involved in coordinating multiple moving objects. Chapter 16 challenges the reader to come up with a brilliant, multi-object coordinator. (Fame and fortune to the first one to solve the problem!)
-
RE: Alternate API, Pioneers Wanted
@chrisglasier said:
I believe the code would easily control the type of animation complexity in this clip:
[flash=425,344:v2ppz0k6]http://www.youtube.com/v/cBDihpeXkFQ[/flash:v2ppz0k6]
but I would be grateful for your confirmation.
Thanks
Missed your query Chris. Yes, that will work easily. However, if you read my tutorial Chapter 16 I suggest that my Animator controller is not well-suited to moving multiple objects.
-
RE: Does "C" equal "C" ?
@jim said:
try using
p strorputs str.inspectinstead ofputs strto see the exact string including the escape chars.Good idea, tho in this case it wasn't an escape chars issue.
@thomthom said:what is the intent of the code?
To replace a call to my routine with a better use of Ruby:
# this code works, PC and Mac, any way that __FILE__ was loaded pathname = File.expand_path( File.dirname(__FILE__) ) pathname = File.join( pathname, 'myFile.HTML' ) wd.set_file( pathname )@unknownuser said:
puts foo = 'foo: "' + foo + '"'
puts bar = 'bar: "' + bar + '"'Of course they are not the same.
Snow-blind coder error.

-
Does "C" equal "C" ?
Edit: Of course "C" equals "C", (if you don't compound one mistake with another).
Got a better way to handle the WebDialog.set_file()issue, which I'll add to that subject's discussion. Otherwise, this was just stupidity that I'll blame on too much snow shoveling.Back to the WebDialog.set_file() problem. I stumbled across the Ruby
File.expand_path()method that looks like a better replacement for the littlefixup()function I wrote. If youFile.expand_path(__FILE__)you get the full path back to the root, on a Mac, or the drive, on a PC. Perfect!Except that "C:..." does not equal "C:..." in the following:
# /models/airshow/t.rb =begin On a PC, WebDialog.set_file() requires a drive specification. So you get the working directory; dir = Dir;;pwd() The working directory will start with; '/' on a Mac 'C;' (or 'D;' or ...) on a PC 47 == '/' 58 == ';' Prefix the given pathname with 'C;' (or 'D;' or ...) unless a) you are on a Mac b) the given pathname already includes a drive specification =end def fixup( pathname ) dir = Dir;;pwd() pathname = dir[0..1] + pathname unless ( dir[0] == 47 ) || ( pathname[1] == 58 ) return pathname end tfile = 'movie_titles.html' foo = File.expand_path( File.dirname(__FILE__) ) foo = File.join( foo, tfile ) puts foo = 'foo; "' + foo + '"' bar = fixup( File.dirname(__FILE__) ) bar = File.join( bar, tfile ) puts bar = 'bar; "' + bar + '"' puts 'same? ' + (foo==bar).to_s -
RE: Is there any vertex editing plugin?
@chris fullmer said:
Oooh I like what I see Thom. And virtually all your recent questions are suddenly making sense
And yes, I've been trying t speculate what they all added up to....now I know! Good luck,Chris
Please share!
-
RE: SU Ruby + XML
@unknownuser said:
a Ruby callback, which iterates over the SketchUp model and builds an XML document of it
Why is XML better than JSON?
-
RE: Matrix Multiplication Explained
@remus said:
as id guess the answer [why not commutative?] is largely irrelevant to the typical sketchup scripter and would add a great deal of complexity.)
I'd guess that the non-commutative part bites everyone who codes with transformations. Let's see, is that rotation * scale or ... It's got me more than once.
-
RE: Ruby Scrambler Download
@honoluludesktop said:
As a beginner SU ruby programmer, I can say that if it wasn't for the generous help here, and all the unscrambled plugin's around, ...

-
Matrix Multiplication Explained
I've written another appendix for the tutorial. It explains matrix multiplication. Hopefully, this explanation is a lot clearer than most of what you find if you search the web for this topic. It answers that burning question:
Why isn't matrix multiplication commutative?
I've also made some improvements to the "how does the transformation matrix work" appendix.
This board doesn't permit .html files as attachments. Change the .txt extension back to .html and open either in your favorite browser.
Matrix Multiplication - change .txt to .html