sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    How to set length units in code

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 3 Posters 166 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.
    • M Offline
      Mcdull
      last edited by

      I want to pull a face from 0 to 4.5m, and my entities is imported from other software,how to set length units in code?
      for example

      
      pts = []
       pts[0] = [edge.start.position.x, edge.start.position.y, 0]
       pts[1] = [edge.end.position.x, edge.end.position.y, 0]
       pts[2] = [edge.end.position.x, edge.end.position.y, 4.5]
       pts[3] = [edge.start.position.x, edge.start.position.y, 4.5]
      
      

      here,i want to set z value as 4.5m,how to set? thank u

      1 Reply Last reply Reply Quote 0
      • K Offline
        kyyu
        last edited by

        4.5.m
        Just type this in the ruby console, and see what it returns.

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

          If you are getting the x/y/z values as strings [perhaps from an imported text file] then
          ` z=z+'.m'

          4.5.m ### as a string
          eval(z)
          177.165354330709 ### in inches [SUp's base units and used to position the point]if they are as floats then z=z.m` will work to convert it...

          TIG

          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