Originally Posted by
bowes
Someone mentioned to me that they used to have a lisp routine at thier previous place of employment that would make all entities in a drawing have an elevation equal to zero and z-coordinate values of zero. This would make my life alot easier when I need to x-ref surveyor's drawing files into my plans. Does anybody have a lisp routine I could load into Architectural Desktop 2004? I could go crazy over the number of times I could not fillet a line that was drawn by snapping to something in the x-ref with a line I drew because they were not coplaner. Thanks for your help.
Jamie
Here's one I've had for a long time
Code:
(defun c:ELZ (/ cent el ent i na newel nst st stx)
(princ "\nElevation Zero")
(defun WORKING ()
(if (= wrkcnt nil)(setq wrkcnt 0))
(setq wrkcnt (1+ wrkcnt))
(if (= wrkcnt 1)(setq wrk "-"))
(if (= wrkcnt 2)(setq wrk "\\"))
(if (= wrkcnt 3)(setq wrk "|"))
(if (= wrkcnt 4)
(progn (setq wrk "/")(setq wrkcnt 0))
)
(princ (strcat "\n" wrk "\n"))
)
(setq ent (ssget '((-4 . "<OR")(0 . "LINE")(0 . "TEXT")
(0 . "POLYLINE")(0 . "LWPOLYLINE")(0 . "VERTEX")(0 . "ARC")
(0 . "CIRCLE")(0 . "ELLIPSE")(0 . "INSERT")
(0 . "MTEXT")(0 . "POINT")(-4 . "OR>")))
)
(setq el (sslength ent))
(princ el)
(setq i 0)
(repeat el
(working)
(setq na (ssname ent i) i (1+ i))
(setq cent (entget na))
(setq st (assoc 10 cent))
(setq stx (cadr st) sty (caddr st))
(setq nst (list 10 stx sty 0.0))
(setq newel (subst nst st cent))
(entmod newel)
(if (= (cdr (assoc 0 cent)) "LINE")
(progn
(setq na (ssname ent (- i 1)))
(setq cent (entget na))
(setq st (assoc 11 cent))
(setq stx (cadr st) sty (caddr st))
(setq nst (list 11 stx sty 0.0))
(setq newel (subst nst st cent))
(entmod newel)
)
)
)
(princ)
)
(princ)
command: ELZ (select everything you want to set to zero elevation)
Works great.