PDA

View Full Version : Looking for Zero.lsp routine


moshira_hassan
2006-11-09, 06:14 PM
Helloo people .. I need the zero lisp plzzzzzzzzzzzz

madcadder
2006-11-09, 06:16 PM
what is a zero lisp?

moshira_hassan
2006-11-09, 06:22 PM
it's a lisp that change all z coordinates to zero .....

CADmium
2006-11-09, 06:26 PM
try www.cadwiesel.de -> Sonstiges->Sonstiges -> Plaetten

ccowgill
2006-11-09, 06:29 PM
I thought that was the flatten command, and it was an express tool

tedg
2006-11-15, 01:34 PM
it's a lisp that change all z coordinates to zero .....
Here's a good one if you don't have express tools for the "flatten" tool.
It works on most entities, sometimes you need to run it more than once.

(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)


Have fun.

rkmcswain
2006-11-15, 04:33 PM
Helloo people .. I need the zero lisp plzzzzzzzzzzzz

http://groups.google.com/group/autodesk.autocad.customization/msg/8a47cd8a5984d80b?dmode=source&hl=en

BrenBren
2006-11-15, 04:53 PM
Helloo people .. I need the zero lisp plzzzzzzzzzzzz

AutoCAD 2007 also has the FLATSHOT command, which does the same, or as mentioned above, there is the FLATTEN express tool, which showed up, oh, maybe 2005 or so...

sinc
2006-11-16, 01:38 AM
Land Desktop has a "Flatten Z Values" command, which I always thought should have been in Vanilla instead...

BrenBren
2006-11-16, 12:21 PM
Land Desktop has a "Flatten Z Values" command, which I always thought should have been in Vanilla instead...

See my post above - Vanilla does include tools to do this; the command may not be the same but the tools are there :confused:

TobyKanoby
2006-11-16, 03:05 PM
This link suggested by RKMcwain a few threads above is the shortest version I've found.
http://groups.google.com/group/autodesk.autocad.customization/msg/8a47cd8a5984d80b?dmode=source&hl=en

Can anyone explain what the "_si" part of the "move" command is actually doing in that code?
(command "._move" "_si" ssFlat ...

kennet.sjoberg
2006-11-16, 04:00 PM
This link suggested by RKMcwain a few threads above is the shortest version I've found.
http://groups.google.com/group/autodesk.autocad.customization/msg/8a47cd8a5984d80b?dmode=source&hl=en

Can anyone explain what the "_si" part of the "move" command is actually doing in that code?
(command "._move" "_si" ssFlat ...

a getdata function like "fence" or "remove", the "_si" is to accept only one object, you can rewrite the line to :
(command "._move" ssFlat "" to end the select object prompt.

: ) Happy Computing !

kennet