Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Active Contributor
27 Posts
0 Kudos
Registered: ‎02-03-2012
Post 1 of 5

Internal Error with VLA-SAVE and VLA-CLOSE

499 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*
1,660 Posts
190 Kudos
Registered: ‎08-16-2007
Post 2 of 5

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.

Active Contributor
27 Posts
0 Kudos
Registered: ‎02-03-2012
Post 3 of 5

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*
1,660 Posts
190 Kudos
Registered: ‎08-16-2007
Post 4 of 5

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.

 

 

Active Contributor
27 Posts
0 Kudos
Registered: ‎02-03-2012
Post 5 of 5

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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!