- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a Lisp code designed to place a circle if the value is less than 20.0, but it's not functioning properly. Could you please review and correct the Lisp code for me?
(defun c:PlaceCircle ()
(vl-load-com)
(setq blockName "DN_EOL")
(setq attributeName "HIGH_DIGITAL")
(setq circleDiameter 40.0)
(setq blk (tblsearch "block" blockName))
(if blk
(progn
(setq ss (ssget "_X" (list (cons 0 "INSERT")(cons 2 blockName))))
(if ss
(repeat (sslength ss)
(setq ent (ssname ss 0))
(setq atts (entget ent))
(setq attValue nil)
(foreach att atts
(if (eq (car att) (cons 2 attributeName))
(setq attValue (cdr att))
)
)
(if (and attValue (< (atof attValue) 20.00))
(progn
(setq insertPt (cdr (assoc 10 (entget ent))))
(command "_CIRCLE" insertPt circleDiameter)
)
)
)
)
)
)
(princ)
)
Solved! Go to Solution.