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!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update

    Can you round in 30" increments?

    Scheduled Pinned Locked Moved Dynamic Components
    sketchup
    11 Posts 3 Posters 940 Views 3 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.
    • sdmitchS Offline
      sdmitch
      last edited by

      How about

      lenx=((lenx/30.0+0.5).floor * 30.0)
      lenx=30.0 if lenx==0.0
      

      Nothing is worthless, it can always be used as a bad example.

      http://sdmitch.blogspot.com/

      1 Reply Last reply Reply Quote 0
      • brodieB Offline
        brodie
        last edited by

        I'm not quite sure how to use that. The ".floor" isn't valid, right? Is that a mistake or are you describing something?

        -Brodie

        steelblue http://www.steelbluellc.com

        1 Reply Last reply Reply Quote 0
        • brodieB Offline
          brodie
          last edited by

          It looks like the magic code is...

          =round(current("LenX")/30)*30
          

          steelblue http://www.steelbluellc.com

          1 Reply Last reply Reply Quote 0
          • sdmitchS Offline
            sdmitch
            last edited by

            @unknownuser said:

            I'm not quite sure how to use that. The ".floor" isn't valid, right? Is that a mistake or are you describing something?

            -Brodie

            ".floor" is most definitely valid. It is equivalent to ".to_i" in this case.

            Nothing is worthless, it can always be used as a bad example.

            http://sdmitch.blogspot.com/

            1 Reply Last reply Reply Quote 0
            • brodieB Offline
              brodie
              last edited by

              You're bringing me further down the rabbit hole, ".to_i"? What's that?

              If, as a test, I input...

              =100.floor
              

              ...into the LenX box, it gives me an error (not really an error but it doesn't seem to know what to do as it reports back "#=100.floor". Likewise, when I input your code it also doesn't seem to work.

              -Brodie

              steelblue http://www.steelbluellc.com

              1 Reply Last reply Reply Quote 0
              • brodieB Offline
                brodie
                last edited by

                Are we both talking dynamic components or are you referring to ruby scripting?

                -Brodie

                steelblue http://www.steelbluellc.com

                1 Reply Last reply Reply Quote 0
                • Rich O BrienR Offline
                  Rich O Brien Moderator
                  last edited by

                  I'm wondering if Sam is speaking in Ruby? I'm not a DC aficionado but it does look alot like ruby πŸ˜•

                  Download the free D'oh Book for SketchUp πŸ“–

                  1 Reply Last reply Reply Quote 0
                  • Rich O BrienR Offline
                    Rich O Brien Moderator
                    last edited by

                    Oooops double post....

                    Download the free D'oh Book for SketchUp πŸ“–

                    1 Reply Last reply Reply Quote 0
                    • sdmitchS Offline
                      sdmitch
                      last edited by

                      DOH!!!!!!!!!

                      Yes, the .floor and .to_i are Ruby elements. Sorry I didn't realize we were discussing Dynamic Components.

                      Never mind.

                      Nothing is worthless, it can always be used as a bad example.

                      http://sdmitch.blogspot.com/

                      1 Reply Last reply Reply Quote 0
                      • brodieB Offline
                        brodie
                        last edited by

                        @sdmitch said:

                        DOH!!!!!!!!!

                        Yes, the .floor and .to_i are Ruby elements. Sorry I didn't realize we were discussing Dynamic Components.

                        Never mind.

                        ah ha, no worries πŸ˜„ I was hoping I'd missed out on some DC secrets.

                        -Brodie

                        steelblue http://www.steelbluellc.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