DXF group code 10 and 11

Discussion in 'AutoCAD' started by iwafb, Jul 31, 2004.

  1. iwafb

    iwafb Guest

    I am having trouble with trying to find the start and end points of a line in lisp and acad 2005.

    When in ucs world, the start and end points match dxf group 10 and 11. However, as soon as I change to an isometric view and rotate ucs (say 90 deg about world x) it seems to swap the y and z axis values???

    This is the DXF groups and list information of one line:


    Command: (setq a (entget (entlast)))
    ((-1 . <Entity name: 7ef742b8>) (0 . "LINE") (330 . <Entity name: 7ef58cf8>) (5
    "147") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 .
    "AcDbLine") (10 -31319.5 -11220.7 2.22045e-012) (11 -31319.5 -11220.7 13619.1)
    (210 0.0 -1.0 2.22045e-016))
    Command: list
    Select objects: (entlast)
    <Entity name: 7ef742b8>
    1 found

    Select objects:

    LINE Layer: "0"
    Space: Model space
    Handle = 147
    from point, X=-31319.5480 Y= 0.0000 Z=11220.7042
    to point, X=-31319.5480 Y=13619.0682 Z=11220.7042
    Length =13619.0682, Angle in XY Plane = 90
    Delta X = 0.0000, Delta Y = 13619.0682, Delta Z = 0.0000

    Why are the y and z swapping around? Has anyone found this?
     
    iwafb, Jul 31, 2004
    #1
  2. iwafb

    Jürg Menzi Guest

    Hi iwafb

    DXF point groups are always expressed in WCS coordinates, the list command
    in UCS coordinates.
    To translate this points to another coordinate system use 'trans', eg.:
    (trans (cdr (assoc 10 a)) (entlast) 1)
    translates the startpoint of the line to the current UCS.
    For further information around 'trans' search the AutoLISP reference.

    Cheers
     
    Jürg Menzi, Jul 31, 2004
    #2
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.