Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have a simple lisp routine (see below) that allows me to select a node and then inserts a cross and level text at that point.
What I would like is to be able to select multiple nodes (eg crossing box) and then insert the cross and level text (based on the Z value of each individual node) to each node in one go.
Any help appreciated.
Thanks.
(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)
(setvar "CLAYER" "construction")
)
Solved! Go to Solution.