OK, all valid reasons....I was just curious as I had a mentor that believed
(or so it seemed) that everything should be done via API calls. I tend to
use them only on occassion, as it seems you do.
On another, semi-related subject, I noticed in that little bit of code you
posted that you set your ObjectDBX variable to nothing and reset it with
GetInterfaceObject for each drawing. There is no need to do this since
everytime the Open method is used it closes whatever was open previously.
The only time it need be set to nothing is when you are completely done with
it. Again, probably not noticeable, as far as processor time, for only a few
files, but for a bunch it would have an impact.
Regards,
Jeff
"Chris Shoemaker" wrote in message
news:5452321@discussion.autodesk.com...
For me....three reasons...if you're only performing the operation on a few
files, the performence difference is negligable. Secondly, the FSO is easier
for the person who comes along after me to maintin and understand then the
API calls. Third, correct me if i'm wrong but I think you've got a much
better chance of crashing AutoCAD (and possibly the system) with the native
API calls rather then the API wrapped accessible through COM. In other
words...you've got to know a little bit more about what you're doing 🙂
-Chris
"Jeff Mishler" wrote in message
news:5452295@discussion.autodesk.com...
Why? As you noted using the FSO is slower and requires another Reference,
using the API is faster and will work on any Windows machine. (AFAIK)
"Chris Shoemaker" wrote in message
news:5452308@discussion.autodesk.com...
Anyway I try to avoid API calls when i can avoid them.