Hi Chuck,
A couple small things and one BIG reccomendation......
The small things.....I believe your error is coming from this portion:
(setq ent1 (entnext ent1) ;;procceed to the next entity
entlist (entget ent1))
You are using (entget), which is normally fine except when the end of the
database is reached and (entnext) returns nil. Relocating the (entget)
would
solve this.
Next, why change the values to a string? If the conversion function is
just
appending text to the value then you can do that AND keep the associative
values by using prefixes & suffixes.
Now the big thing......(entnext)'ing through a drawing is NOT the way to
do
what you want. Look into Filtered Selection Sets! This will dramatically
reduce the time it takes to run your routine. An example:
(set counter -1)
(if (setq ss (ssget "x" '((0 . "DIMENSION")(1 . ""))));;gets ALL
dimensions
that do not use the text override
(progn
(while (< (setq counter (1+ counter)) (sslength ss));keep going while
counter is less than ss length
(setq ent (ssname ss counter))
;;do your stuff with the dimension......
);while
);progn
);if
HTH,
--
Jeff
check out
www.cadvault.com
"chuck" <chuck@nospam.wo> wrote in message
news:k72ed.2782$0v6.979@read1.cgocable.net...
Hi everyone Iv'e written a lisp routine which might seem primitive to
some.
This is what I want to happen.... I want the routine to perform an
operation
"txtfr" which will format the text of all dimension entities on the
drawing
to a customized font and then exit the progar "quietly". As it stands
every
time I rum the program I will get an error message following the
execution
of the program. The program works perfectly the first time, with the
exception of the error message, but on subsequent attempts, I have to
run
the program twice in order for it to take effect. I am quite new at
using
the "while" and "if" logic combination in a program and am wondering if
there might be something wrong here. Can anyone help?