AutoCAD

Flatten a 3D Drawing 1.0.0

skyground21 2021. 11. 9. 12:31
반응형
;   Flatten a 3D drawing 
;   Written by Lee Mac (http://www.lee-mac.com/)
;   This script will set all z values to zero, efectively flattening any 3D drawing. 
;
(defun c:flat ( / doc org )
   (setq doc (vla-get-activedocument (vlax-get-acad-object))
         org (vlax-3D-point 0 0 0)
   )
   (vlax-for blk (vla-get-blocks doc)
       (if (= :vlax-false (vla-get-isxref blk))
           (vlax-for obj blk
               (if (vlax-write-enabled-p obj)
                   (foreach elv '(1e99 -1e99) (vla-move obj org (vlax-3D-point 0 0 elv)))
               )
           )
       )
   )
   (vla-regen doc acallviewports)
   (princ)
)
(vl-load-com) (princ)

Flatten a 3D Drawing 1.0.0

 

This script will set all z values to zero, efectively flattening any 3D drawing. 

 

flat.lsp
0.00MB

반응형