#AVOIDING BAD ENTMOD
7 messages in this thread
SYSOP
I've finished a lisp I've been working on, save for a way around getting
the dreaded "Bad entmod list". I'm using "(setq a1 (list (assoc -1
var)(cons 39 pck)))" to change thickness of an entity (& 40 height, 41
width, etc.). I havent't been able to figure out a way to prescreen "a1"
so a bad list I can then divert from going through "(entmod a1)". I
realize you can use an "initget", but in some cases this would be most
impractical.
If I could screen the a1, obviously I could then divert the entmod
statement with an "if" statement. Any suggestions on how determine this?
Appreciatively,
Jeff
Jeff – I don't know about this "dreaded 'bad entmod list'". Can you give
us an example?
Duff
I thought I did. Let's try it again:
I've finished a lisp I've been working on, save for a way around getting
the dreaded "Bad entmod list". I'm using "(setq a1 (list (assoc -1
var)(cons 39 pck)))" to change thickness of an entity (& 40 height, 41
width, etc.). I havent't been able to figure out a way to prescreen "a1"
so I can then divert a "bad" list from going through "(entmod a1)". I
realize you can use an "initget", but in some cases this would be most
impractical.
If I could screen the a1, obviously I could then divert the entmod
statement with an "if" statement. Such as if "pck=nil" then a bad entmod
list will come up. There are other possibilities for "(entmod a1)" to come
up with this message. I would like a "simple" way to catch these inputs
before they crash the routine. Any suggestions on how determine this?
Appreciatively,
Jeff
Jeff – That's a repeat of your original message, right? I saw that one,
which is why I quoted your "dreaded 'bad entmod list'" in the first place.
But your messages doesn't give me anything to work with in tracking down
the problem or suggesting a remedy. If you were to uplaod an actual
example of a routine, or data, that results in this message, then maybe we
can get somewhere.
Jeff – You must manually examine all input that is destined for (entmod) (or
just about any other AutoCAD operation), and validate it, to be sure that it
is the proper type of data, an within the range that is accepted for whatever
operation is using it.
Without a more specific example that shows me what value is causing the error,
I really can't help you. If you can post the list that was sent to (entmod)
to cause the error, then perhaps I can give you a hint on what might be the
problem.
-TonyT.
Tony
I've finished a lisp I've been working on, save for a way around getting
the dreaded "Bad entmod list". I'm using "(setq a1 (list (assoc -1
var)(cons 39 pck)))" to change thickness of an entity (& 40 height, 41
width, etc.). I havent't been able to figure out a way to prescreen "a1"
so I can then divert a "bad" list from going through "(entmod a1)". I
realize you can use an "initget", but in some cases this would be most
impractical.
If I could screen the a1, obviously I could then divert the entmod
statement with an "if" statement. Such as if "pck=nil" then a bad entmod
list will come up. There are other possibilities for "(entmod a1)" to come
up with this message. I would like a "simple" way to catch these inputs
before they crash the routine. Any suggestions on how determine this?
Appreciatively,
Jeff
Jeff – I think I responded to your first message on this, along with Duff.
Did you receive it?
Anyways, both Duff and myself asked you to provide a specific example, and
you haven't done that. We see the (entmod) expression, but you cannot ask
us to *guess* exactly where the value you are passing to (entmod) is coming
from, and that is where your problem lies.
Keep in mind that (entmod) is the most direct means of modifying AutoCAD's
database, and hence, there is NO USER INTERFACE to it – that part is the
responsiblity of your program, to obtain the input, validate it, and if
necessary, reject it if it is not appropriate.
Now, if you can show us how you are obtaining the input, and what you do
with it before attempting to hand it to AutoCAD via (entmod) then perhaps
we can suggest something, but we cannot tell you what is wrong with some-
thing that we haven't ever seen before.
-TonyT.