sketchucation logo sketchucation
    • Login
    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

    Calculate button in a messagebox?

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 4 Posters 290 Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T Offline
      tallbridgeguy
      last edited by

      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

      Nielsen
      http://www.tallbridgeguy.com/

      1 Reply Last reply Reply Quote 0
      • TIGT Online
        TIG Moderator
        last edited by

        Yes... but you must use web-dialog...

        TIG

        1 Reply Last reply Reply Quote 0
        • jeff hammondJ Offline
          jeff hammond
          last edited by

          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?

          dotdotdot

          1 Reply Last reply Reply Quote 0
          • T Offline
            tallbridgeguy
            last edited by

            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


            beam section regular.jpg


            concbeam.rb

            Nielsen
            http://www.tallbridgeguy.com/

            1 Reply Last reply Reply Quote 0
            • Dan RathbunD Offline
              Dan Rathbun
              last edited by

              Here's a few topics that you should read, with hints and some code:

              Evaluate expression as input to input form

              [Code] Parsing arithmetic formulas

              I'm not here much anymore.

              1 Reply Last reply Reply Quote 0
              • jeff hammondJ Offline
                jeff hammond
                last edited by

                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:

                beam.skp

                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..

                dotdotdot

                1 Reply Last reply Reply Quote 0
                • T Offline
                  tallbridgeguy
                  last edited by

                  Thanks Jeff! Let me look at it a bit, I'm not used to dynamic components. It look pretty cool.

                  Thanks again!

                  s

                  Nielsen
                  http://www.tallbridgeguy.com/

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  Buy SketchPlus
                  Buy SUbD
                  Buy WrapR
                  Buy eBook
                  Buy Modelur
                  Buy Vertex Tools
                  Buy SketchCuisine
                  Buy FormFonts

                  Advertisement