How do items 10 and 11 work in the DXF code for splines work ?

DFLY
edited December 2023 in LISP Codes
Hello, I'm writing a script to move everything in a block using the location identifiers 10 and 11. But int testing I discovered that splines behave strangely. Can someone please tell me how the items 10 and 11 (and perhaps 40) in the items DXF code (entget) control the splines shape and location ?

Comments

  • ALANH said:
    Thanks for the link. It turned out that I had to modify 10, 11, and 40 for splines; 10 and 11 for lines; only 11 for everything else. The code worked, but sadly there no way it will work on solids. They appear to work on a totally different structure (ACIS).
  • Tim_M
    edited January 21
    DFLY,

    All entities can be moved by using the TransformBy AX Method.
    Below is code to move an entity by a displacement (point).
    ;
    ; Function: ename-moveby
    ; Help: moves an entity by a point.
    ;
    ; ename = drawing entity ename
    ; point = (list x y z) of reals
    ;
    (vl-load-com) ; load com extensions
    
    (defun ename-moveby (ename POINT / axo tmatrix)
    (setq axo (vlax-ename->vla-Object ename))
    (setq tmatrix (list
        (list 1.0 0.0 0.0 (car POINT))
        (list 0.0 1.0 0.0 (cadr POINT))
        (list 0.0 0.0 1.0 (caddr POINT))
        (list 0.0 0.0 0.0 1.0)
        )
      )
      (vla-transformby axo (vlax-tmatrix tmatrix))
      (vlax-release-Object axo)
      )
    For more info on the tmatrix, refer to the TransformBy method documentation on the ACAD site...
  • Tim_M said:

    DFLY,

    All entities can be moved by using the TransformBy AX Method.
    Below is code to move an entity by a displacement (point).

    ;
    ; Function: ename-moveby
    ; Help: moves an entity by a point.
    ;
    ; ename = drawing entity ename
    ; point = (list x y z) of reals
    ;
    (vl-load-com) ; load com extensions
    
    (defun ename-moveby (ename POINT / axo tmatrix)
    (setq axo (vlax-ename->vla-Object ename))
    (setq tmatrix (list
        (list 1.0 0.0 0.0 (car POINT))
        (list 0.0 1.0 0.0 (cadr POINT))
        (list 0.0 0.0 1.0 (caddr POINT))
        (list 0.0 0.0 0.0 1.0)
        )
      )
      (vla-transformby axo (vlax-tmatrix tmatrix))
      (vlax-release-Object axo)
      )
    For more info on the tmatrix, refer to the TransformBy method documentation on the ACAD site...
    Thanks, I'll give it a go.