I'm writing a lisp program in AutoCAD '04 using the offset command to use on polylines the have combinations of lines and arc's in it (inside & outside arc's).
Sometimes an anomaly occurs and a bad entity is created with "no vertices"... CRASH!
Or no offset really occurs, and the entlast sets the variable with the wrong entity (wrong entity changes properties).
In a nut-shell:
I'm offsetting the same entity multiple times, at different distances, to different layers.
The problem is, the offset distances are really small most of the time (which allows the offset to work correctly... sometimes... and sometimes the anomaly occurs).
But when the offset is greater than 0.04, I divide the distance by 0.0156, and offset the new entity X-amount of times to equal the target offset distance (erasing the temporary entities).
My biggest problem is:
This works fine in '04, but in '02 an entity is created (in the temporary entities), that has "no vertices", then when the temporary entity is offset again, or changed to different properties, it locks-up (because it's a bad entity).
If the offset command issues "cannot offset that entity" (the internal offset command error) error and makes a mistake, how can I trap it and insure the offset fails or succeeds, every time?
(I tried the "vl-cmdf" command, but it always returns T, even when it fails)
Also, when the offset doesn't offset, "entlast" changes the "last" entity (but it shouldn't change anything if a new "valid" entity isn't created).
Thanks!