Coordinate Problem

Discussion in 'AutoCAD' started by gorkemt, May 21, 2004.

  1. gorkemt

    gorkemt Guest

    I'd like get beginning and ending coordinates of a line, I know it 's easy. However, because I'm working in 2500000, 2000000 coordinate system, when I use "entget" command coordinates are coming up like this (10 2.60067e+006 2.05687e+006 0.0). If I want to use them again, i get an error message. Anybody has an advice.
    Thank you,
    Gorkem
     
    gorkemt, May 21, 2004
    #1
  2. gorkemt

    David Bethel Guest

    How are you storing the data? -David
     
    David Bethel, May 21, 2004
    #2
  3. gorkemt

    Jim Claypool Guest

    If you set the point to a variable yopu can use it.
    (setq pt (cdr (assoc 10 (entget ename))))

    If you are needing it as a text value, you will need to do a little
    conversion
    example:
    (rtos (car pt) 2 4) will give you the x coordinate with 4 decimal
    places.
    (rtos (cadr pt) 2 4) gives you the y coordinate
    (rtos (caddr pt) 2 4) gives you the z coordinate if required

    easy. However, because I'm working in 2500000, 2000000 coordinate system,
    when I use "entget" command coordinates are coming up like this (10
    2.60067e+006 2.05687e+006 0.0). If I want to use them again, i get an error
    message. Anybody has an advice.
     
    Jim Claypool, May 21, 2004
    #3
  4. gorkemt

    gorkemt Guest

    I'd like to store the data as a point like (x, y, z) in a lisp code.
    For example;
    (setq m (car (entsel)))
    (setq n (entget m))
    (setq k(cdr (assoc 10 n)))
     
    gorkemt, May 21, 2004
    #4
  5. gorkemt

    gorkemt Guest

    Thank you Jim,
    but i tried it before but it did not work.
     
    gorkemt, May 21, 2004
    #5
  6. gorkemt

    OLD-CADaver Guest

    (10 2.60067e+006 2.05687e+006 0.0)

    Is a valid point coord What error are you getting? It shouldn't be related to this unit display format.

    (setq a (entget (car (nentsel "\N Select line"))))
    (setq pt1 (cdr (assoc 10 a)))

    PT1 will be the valid start point of the line even if it's display looks like the line at the top.
     
    OLD-CADaver, May 21, 2004
    #6
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.