Message 1 of 12
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How would I modify this lisp routine to add elevations to the points created. I would need the point z value set to the multileader content field. Attaching example file as well.
(defun LM:mleadervertices ( ent )
(mapcar '(lambda ( x ) (massoc 10 x))
(massoc "LEADER_LINE{"
(cdr
(assoc "LEADER{"
(cdr
(assoc "CONTEXT_DATA{"
(parsedxfdata (entget ent))
)
)
)
)
)
)
)
(defun massoc ( k l )
(mapcar 'cdr (vl-remove-if-not '(lambda ( x ) (= k (car x))) l))
)
(defun parsedxfdata ( l / foo )
(defun foo ( / x )
(setq x (car l)
l (cdr l)
)
(cond
( (or (null x) (= "}" (cdr x)))
nil
)
( (and (= 'str (type (cdr x))) (wcmatch (cdr x) "*{*"))
(cons (cons (cdr x) (foo)) (foo))
)
( (cons x (foo)))
)
)
(foo)
)
(defun c:test ( / c e )
(if
(and
(setq e (car (entsel "\nSelect mleader: ")))
(= "MULTILEADER" (cdr (assoc 0 (entget e))))
(setq c 1)
)
(foreach l (LM:mleadervertices e)
(foreach v l
(entmake (list '(0 . "POINT") (cons 10 v) (cons 62 c)))
)
(setq c (1+ (rem c 255)))
)
)
)
Solved! Go to Solution.