Calculate button in a messagebox?
-
I was trying to write a little ruby, where you can enter some numbers in a dialog box (messagebox?) and before the window closes you can hit a calculate button.
The button would trigger a calculation using the numbers you entered. When you are satisfied with your results you could hit a "draw" button (in the same window) and it would use the info to draw a shape. Sort of like a calculator? with a draw feature.
Why..well I want to calculate the cross-section of a beam I would need for a certain moment, changing variables until I get what I want, and then draw it.
Is this possible?
thanks!
s
-
Yes... but you must use web-dialog...
-
with a workaround or two (or maybe none depending on the cross-section profile) you can probably do this using dynamic components.. the dc dialog is actually a super good calculator though the implementation isn't the best..
you mind uploading the profile and showing the variables?
-
Hi Jeff. (thanks Dan for the link.)
I want to develop a ruby for a concrete design class I teach.
The goal is to input variables and hit calculate to see if the variables you chose make a strong enough concrete beam. Then you would hit draw the cross section.
I would also like to add a list of rebar sizes that a user can choose from a drop down bar and that would go in the cross-section.
Hopefully this will encourage then to learn sketchup!
here is my first noobie ruby attempt.
thanks!
Stuart
-
Here's a few topics that you should read, with hints and some code:
-
yeah, so i don't really know what that stuff means (f'c psi ... fy psi ??? ) so i just copied your formulas and terms..
this dc could be better organized/named but since i don't really get the end result, i can't think of a decent way to organize it..here's the dc:
just click on the beam and go Window->Component Options
you might like it better as everything can update (size, formulas, etc) without leaving the dialog so it makes it easier to try a bunch of combos..
i started to add some rebar in there but stopped because i don't know what it's supposed to do in this case.. it could easily be tied into the whole thing though..
-
Thanks Jeff! Let me look at it a bit, I'm not used to dynamic components. It look pretty cool.
Thanks again!
s
Advertisement