sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Metrics or inches

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 4 Posters 1.2k 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.
    • M Offline
      Maggy
      last edited by

      I'm trying to use extrude_faces_along_normal.rb. My model is in meters. But when I try to extrude faces 16 meters, it does extrude exactly 16 inches. When I type in 16m instead of 16, nothing happens. I tried again after using a calculator to convert 16 meters to inches, typed in 630 but then the extrusion was much too long, didn't measure. (630 feet? 630 yards?)

      Then I looked into this script, it looks extremely simple but I can't find where it decides wether to use inches, feet, yards, meters or whatever. I dived into "Programming Ruby", couldn't find the answer, searched the ruby forum... I'm lost.

      BTW I do not know who wkai is, the writer of this ruby, but once I get it to work, it'll save me te manual extrusion of 19000 faces! Just in one project. I believe we, ruby downloaders, can't ever thank ruby writers enough for all the time they save us.

      [Maggy]

      1 Reply Last reply Reply Quote 0
      • jujuJ Offline
        juju
        last edited by

        @maggy said:

        I believe we, ruby downloaders, can't ever thank ruby writers enough for all the time they save us.

        True, true. Thx to all the ruby programmers out there, even the ones I pay for scripts... πŸ˜‰

        Save the Earth, it's the only planet with chocolate.

        1 Reply Last reply Reply Quote 0
        • Didier BurD Offline
          Didier Bur
          last edited by

          @unknownuser said:

          I dived into "Programming Ruby", couldn't find the answer, searched the ruby forum... I'm lost

          All distances and lengthes are stored in inches in SU. Totally idiot IMHO, but that's the way it is.
          Replace the following line: e.pushpull Float( dist[0])
          with e.pushpull Float( dist[0]).m

          That's it !

          To convert a metric number in inches, for instance 16m, you can type in the Ruby console: 16.m and you'll get 629.92125984252

          Cheers

          DB

          1 Reply Last reply Reply Quote 0
          • M Offline
            Maggy
            last edited by

            Thanks a lot!
            It's all over the docs that SU internally only uses inches. But no simple explanation on how to change an imperial script to metrics. A bit strange (read: yes, idiot indeed).

            I guessed, after looking into existing scripts, that .m somewhere should do the trick.
            I probably tried
            e.pushpull Float( dist[0])".m"
            e.pushpull Float( dist[0].m)
            e.pushpull Float( dist[0.m])
            e.pushpull Float( dist.m[0])
            plus several other places in the script.

            And I already found out that in this case e.pushpull 630 gave an acceptable result after all. The first time I tried that I must have accidentally pushpulled a much smaller face than I thought.

            [Maggy]

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

              If you want to change the default displayed unit in a model via Ruby, you have to change an Option (See Ruby Help>Classes>OptionManager). They are all stored in a Hash. If you want more help, lemme know.

              Also, you might try typing in "16.meters" (no quotes).

              Todd

              1 Reply Last reply Reply Quote 0
              • M Offline
                Maggy
                last edited by

                Thanks Todd, I'll look into it in case I'm going to need it (likely) but Didier already solved it for this script.

                [Maggy]

                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