- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I've got a lot of Lisp routines that I use mainly for annotation work on Autocad survey drawings. They're all 10+ years old and a lot of them weren't working on the latest Autocad. I've managed to diagnose the problem which involved removing all the QUICK commands. All the routines seem to be working fine now.
A lot of the routines involve snapping to nodes and extracting the z values for levelling annotation (spot levels, cill and head heights, beam levels etc.). The additional problem I now have is that I've started working with pointcloud data and none of the routines seem to want to snap to pointcloud nodes. These routines were all written by a previous work colleague and my programming skills are very rudimentary so I'm a bit lost as to how to proceed. I'm not entirely certain if it's even a Lisp problem, or some other setting I've got wrong in Autocad, or just a fundamental misunderstanding on my part.
here's an example - the command LP allows me to pick a node, then a cross and level text from the z value of the node is automatically inserted. If I try to pick the node of a pointcloud it doesn't work. It only seems to recognise cad points, not pointcloud points. Anyone got any ideas? Thanks in advance.
(defun C:LP (/ pt tat Y olderr)
(setq olderr *error* ; Initialize variables
*error* cterr
)
(setvar "cmdecho" 0)
(SETQ OSM (GETVAR"OSMODE"))
(SETQ lll (GETVAR"CLAYER"))
(setq a(getvar "textsize"))
(COMMAND "OSNAP" "NODE")
(setq pt(getpoint "Whereabouts...?"))
(COMMAND "OSNAP" "NONE")
(SETQ X (CAR PT))
(setq Y (cadr pt))
(SETQ Z (RTOS (CADDR PT) 2 2))
(setq XYPT(LIST (CAR PT)(CADR PT)))
(setq Tat (LIST X (- Y (* 2 a))))
(command "layer" "M" "LX" "")
(COMMAND "INSERT" "CROSS" XYpt a "" 0.0)
(command "layer" "M" "LTEXT" "")
(COMMAND "TEXT" tat "" 0.0 Z)
(SETVAR "OSMODE" OSM)
(COMMAND "LAYER" "S" lll "")
(setq *error* olderr) ; Restore old *error* handler
(princ)
)
Solved! Go to Solution.