Precision of polyline

Discussion in 'AutoCAD' started by Bill Barrows, Jan 6, 2004.

  1. Bill Barrows

    Bill Barrows Guest

    How can I change the precision I am getting from the polyline entity list?
    (Acad 2000i)


    I setvar luprec to 8, but when I use:
    (setq en (car (entsel "\nSelect polyline: ")))
    (setq el (entget en))
    The first vertex has only 4 decimal places. (10 0.0 12.6346)

    When I list the polyline the same vertex is at:
    at point X=0.00000000 Y=12.63464111 Z=0.00000000

    Thanks,
    Bill
     
    Bill Barrows, Jan 6, 2004
    #1
  2. Bill Barrows

    R.K. McSwain Guest

    Try this on a LWPOLYLINE

    (setq en (car (entsel "\nSelect polyline: ")))
    (setq el (entget en))
    (setq v (cdr (assoc 10 el)))
    (setq vx (rtos (car v) 2 16)
    vy (rtos (cadr v) 2 16))
    (alert (strcat "X = " vx "\nY = " vy))

    Hint: The values you see are rounded, use (rtos) to see complete value.
     
    R.K. McSwain, Jan 6, 2004
    #2
  3. Bill Barrows

    BillZ Guest

    The precision is there. AutoCAD just doesn't display it.

    Try (rtos (caddr "firstvertexvar")) 2 22)
    and it should read "12.6346411100000000000000"

    Bill
     
    BillZ, Jan 6, 2004
    #3
  4. Bill Barrows

    R.K. McSwain Guest

    Interesting, I'm not sure how you are getting 22 decimal places, since there are only 15 significant digits available.

    (rtos 1 2 22) = "1.000000000000000"
     
    R.K. McSwain, Jan 6, 2004
    #4
  5. Bill Barrows

    ECCAD Guest

    Must have one of the new CPU's (128 bit). ?
    Couldn't resist.
     
    ECCAD, Jan 6, 2004
    #5
  6. Bill Barrows

    BillZ Guest

    Okay wise guys.

    (setq e 1e-122)

    (rtos e 2 22)

    "0.0000000000000000000000"

    Works for me.


    Bill
     
    BillZ, Jan 6, 2004
    #6
  7. Bill Barrows

    R.K. McSwain Guest

    What version of AutoCAD?
     
    R.K. McSwain, Jan 7, 2004
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.