Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Contributor
jleavitt
Posts: 17
Registered: ‎02-03-2012
Message 1 of 5 (408 Views)

Internal Error with VLA-SAVE and VLA-CLOSE

408 Views, 4 Replies
04-25-2012 11:11 AM

When I try to run this code:

 

(VLA-SAVE (VLA-ITEM (VLA-GET-DOCUMENTS (VLAX-GET-ACAD-OBJECT)) 1))

 

or

 

(VLA-CLOSE (VLA-ITEM (VLA-GET-DOCUMENTS (VLAX-GET-ACAD-OBJECT)) 1))

 

where the item returned from the vla-item routine is an inactive, but open drawing I get the following message:

 

INTERNAL ERROR: VL namespace mismatch

 

and I have to close AutoCAD using Windows Task Manager.

 

The VLA-SAVE and VLA-CLOSE commands work with an inactive, open, but empty drawing, so why doesn't it work with the ones that have data in them?

 

Thanks,

 

J Leavitt

*Expert Elite*
dbroad
Posts: 1,507
Registered: ‎08-16-2007
Message 2 of 5 (390 Views)

Re: Internal Error with VLA-SAVE and VLA-CLOSE

04-26-2012 05:11 PM in reply to: jleavitt

I don't recommend using lisp to close the current drawing anyway so it is probably a good thing the error happens.  What are you trying to do?  Are you scripting multiple drawings?  If so, consider using objectdbx or scriptpro.  Avoid closing the current drawing with lisp because the program has not finished its execution and loses its namespace.

Contributor
jleavitt
Posts: 17
Registered: ‎02-03-2012
Message 3 of 5 (377 Views)

Re: Internal Error with VLA-SAVE and VLA-CLOSE

04-27-2012 06:36 AM in reply to: dbroad

No, I'm trying to save or close the inactive drawings, not the active one.

 

I have written routines that modify dictionary entries and Xdata in the inactive documents based on editing in the active drawing and I'm looking for a reliable way to save those edits.  I could always take the long way around and visit each of the documents individually, but it would be so much more convenient to be able to save all the edits at once.

Express Tools has that capability, but I get the same error when I try to use it.

 

Thanks,

 

J Leavitt

*Expert Elite*
dbroad
Posts: 1,507
Registered: ‎08-16-2007
Message 4 of 5 (369 Views)

Re: Internal Error with VLA-SAVE and VLA-CLOSE

04-27-2012 10:15 AM in reply to: jleavitt

Are you sure that item 1 is not the current drawing? Are you sure that item 1 exists?  It won't if AutoCAD only has 1 drawing open.

 

As you close drawings, the index number of a particular drawing may change.  For instance, if you close item 1 of the docs collection, item 2 becomes item 1 but item 0 would not change.

 

 

Contributor
jleavitt
Posts: 17
Registered: ‎02-03-2012
Message 5 of 5 (365 Views)

Re: Internal Error with VLA-SAVE and VLA-CLOSE

04-27-2012 01:34 PM in reply to: dbroad

No, the indices are all correct.  That was one of the first things that I checked.  I have a suspicion that the problem is drawing-specific, possible due to an error in the database. perhaps.

 

Thanks,

 

J Leavitt

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community