muthu123 Posted November 23, 2010 Posted November 23, 2010 Dear friends, I have used the following code but it returns the error as "; error: Automation Error. AutoCAD is unable to service automation request" what is wrong with this code? (Setq cur_user_temp_location (vla-get-QNewTemplateFile (vla-get-files (vla-get-Preferences (vlax-get-acad-object))))) (vlax-invoke-method (vla-get-activedocument (vlax-get-acad-object)) 'NEW cur_user_temp_location) (vla-new (vla-get-activedocument (vlax-get-acad-object)) cur_user_temp_location) Quote
jammie Posted November 23, 2010 Posted November 23, 2010 Hi muthu123 The AutoLisp help files seems to recommend using (VLA-ADD <documentCollection> <dwt>) as opposed to the (VLA-NEW <document> <dwt>) Maybe (Setq cur_user_temp_location (vla-get-QNewTemplateFile (vla-get-files (vla-get-Preferences (vlax-get-acad-object))) ) ) (VLA-ADD (vla-get-DOCUMENTS (vlax-get-acad-object)) cur_user_temp_location ) Quote
muthu123 Posted November 24, 2010 Author Posted November 24, 2010 It is ok. But i hope it will be applicaple for only When SDI set to 0. But i need in SDI mode. Hi muthu123 The AutoLisp help files seems to recommend using (VLA-ADD <documentCollection> <dwt>) as opposed to the (VLA-NEW <document> <dwt>) Maybe (Setq cur_user_temp_location (vla-get-QNewTemplateFile (vla-get-files (vla-get-Preferences (vlax-get-acad-object))) ) ) (VLA-ADD (vla-get-DOCUMENTS (vlax-get-acad-object)) cur_user_temp_location ) Quote
jammie Posted November 24, 2010 Posted November 24, 2010 Correct, it would be for MDI as opposed for SDI. I am not sure how to achieve this in SDI. There is some info on the error in the Quit Method of the AutoCAD developers help files Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.