My second and last question of the day
We sometimes draw 3d polylines and points with a z value, which are later flattened to produce 2d elevations.
I'm looking for a way of checking whether a drawing has any 3d elements in it during a finalisation process and if there are then the lisp would prompt the user whether this is correct or whether superflatten should be run.
Here is a lisp I hoped would enable this but it doesn't seem to work to well, the extmin and extmax z values variable doesn't seem to be the way to go.
Using this lisp sometimes it says the drawing is flat sometimes not.
;; Check Z extents.
(defun c:CZ ( )
(command "._zoom" "_extents")
(if
(and
(equal 0.0 (caddr (getvar "extmin")) 1e-6)
(equal 0.0 (caddr (getvar "extmax")) 1e-6)
)
(princ "\nDrawing is flat. ")
(princ "\nDrawing is not flat. ")
)
(princ)
) ;end
here is the output between runs, the z value for some reason after the zoom extent are different:
Command: (getvar "extmin")
(505.391 33.6885 0.0)
Command: (getvar "extmax")
(534.838 60.987 0.0)
Command: cz
._zoom
Specify corner of window, enter a scale factor (nX or nXP), or
[All/Center/Dynamic/Extents/Previous/Scale/Window/Object] <real time>: _extents
Command:
Drawing is not flat.
Command: (getvar "extmax")
(534.838 61.0189 3.49246e-008)
Command: (getvar "extmin")
(505.384 33.6729 -0.00152582)
Does anybody have a better method of determining whether there are any entities with a z value other than 0?
Many thanks
P