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

    Incorrect units

    Scheduled Pinned Locked Moved Dynamic Components
    sketchup
    3 Posts 2 Posters 1.1k Views 2 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.
    • thomthomT Offline
      thomthom
      last edited by

      I was making a DC where the root object at some point was set to inches, but not the other child objects. I changed it back to metric, but there seem to be something wrong still.

      I made a property, Section length, which in the scene attached is 1200mm, but the DC Option displays it as 3048mm. (The whole model is in mm.)
      In the DC the value is 120 (cm). and if you measure in the model it's the correct length. But it's the Option box that displays the incorrect unit.

      How can I correct this?


      Balkong Rekkverk.skp

      Thomas Thomassen β€” SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply Reply Quote 0
      • scottliningerS Offline
        scottlininger
        last edited by

        @thomthom said:

        I made a property, Section length, which in the scene attached is 1200mm, but the DC Option displays it as 3048mm. (The whole model is in mm.)

        Hey ThomThom,

        The units assigned to your Section_Length attribute are "Text" with a value of "120". When you set the "Display in" units to mm (or, in your case, default it to the model units of mm), then we have to do a conversion from "text" to "mm". The conversion engine assumes that raw text strings that contain numbers are inches -- which is the weirdness that you're seeing.

        The fix is easy. Go into your Attribute details and change the units from "Text" to "Cm". Then the conversion engine will understand what you mean better, and you should see what you want. (Note that when you change this unit, the engine will automatically do the conversion from text to cm... so you'll need to change the attribute value from 204.8cm back to 120cm.)

        Let me know if you have more questions!

        Cheers,

        • Scott Lininger
          SketchUp Software Engineer
          Have you visited the Ruby API Docs?
        1 Reply Last reply Reply Quote 0
        • thomthomT Offline
          thomthom
          last edited by

          Aaah! 😳 That, I should have spotted.
          Thanks Scott.

          Thomas Thomassen β€” SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          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