Originally Posted by
pvogt50
Dear Ccowgill,
I think that the method with subst is more general,
and for example also on tables can be applied.
Furthermore I am rather unknown with Visual Lisp.
The subroutine where I am in search of, is lost.
Regards
Like this:
Code:
(defun ChNthDxf (e n code value / ed newDxf i)
(setq ed (entget e)
newDxf '()
)
(setq i 1)
(foreach v ed
(if (= (car v) code)
(progn
(if (= i n)
(setq newDxf (cons (Cons code value) newDXf))
(setq newDxf (cons v newDxf))
)
(setq i (1+ i))
)
(setq newDxf (cons v newDxf))
)
)
(entmod (reverse newDXf))
(entupd e)
)
Code:
(defun c:Demo ()
(command "_.ERASE" "_ALL" "")
(command "_.PLINE" "35,35" "_W" "0" "" "@70<0"
"@70<90" "@70<0" "@70<270" "_W" "2" "2"
"@70<0" "_W" "0" "" "@70<90" "@70<0"
"@70<270" "@70<0" ""
)
(command "_.ZOOM" "_ALL")
(princ
"\nNo constant Width because DXF code 43 must not set.\n"
)
(setq e (entlast))
(command "_.DELAY" "700")
(ChNthDxf e 2 10 '(120 80))
(command "_.DELAY" "700")
(ChNthDxf e 9 10 '(300 80))
(command "_.DELAY" "700")
(ChNthDxf e 3 40 5.0)
(command "_.DELAY" "2000")
(ChNthDxf e 3 41 22.0)
(command "_.DELAY" "700")
(ChNthDxf e 7 40 22.0)
(command "_.DELAY" "2000")
(ChNthDxf e 7 41 5.0)
(princ
"\nNo constant Width because DXF code 43 must not set."
)
(princ)
)
HofCAD CSI