Quantcast
Viewing all articles
Browse latest Browse all 14319

AutoLisp Integration with Database.SaveAs results in eFileAccessErr

Hey all,

 

I've been having some strange things happen ever since I changed my program to start from AutoLisp rather than a command.

 

Below I will describe what happens when I call Document.CloseAndSave and Database.SaveAs when I run my program from either AutoLisp or from a command.

 

 

AutoLisp

Method Attribute:

[LispFunction("BOMGEN")]

When I call Database.SaveAs(), I get an eFileAccessErr and a message box pops us saying "Error Writing/Closing File"

 

When I call Document.CloseAndSave(), while omitting Database.SaveAs(), my drawing appears to close properly expect I find that when I open it back up no changes were saved!

 

 

 

Command:

Method Attribute:

[CommandMethod("BOMGEN", CommandFlags.Session)]

 

When I call Database.SaveAs(), my drawing saves properly.

 

When I call Document.CloseAndSave(), in succession with Database.SaveAs(), the drawing closes (no idea if it actually saves twice, but to be honest I don't care!  Once is all I need.)  

 

 

So, I'm looking to run my program from an AutoLisp command:

(bomgen)

However, I cannot save the drawings using the methods described above. Is there an alternate way to save drawings? Or do I need to make further steps when switching to an AutoLisp command?

 

 

I believe I read something that generally stated that .NET dlls had some quirks when used from AutoLisp regarding connectivity to the Documents collection.  I don't know where I read this or if it's accurate, but in case it helps, I've got it up here! :)

 

 

Thanks much,

-Nicholas

Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 14319

Trending Articles