Author Topic: vla-close help please.  (Read 4593 times)

0 Members and 1 Guest are viewing this topic.

mr_nick

  • Guest
vla-close help please.
« on: November 17, 2006, 10:41:52 AM »
I am attempting to close a file using VLA-CLOSE but after successfully closing the required document, all further lisp commands fail giving the error

AecRcpLispSupport::getArgIgnore() got null."

The syntax I am using to close the file is:

(vla-close (vla-item (vla-get-documents (vlax-get-acad-object)) "temp.dwg") :vlax-false)

The file is not active and does not need to be saved and this is doing what I need, it's just that I cannot continue any routines after issuing this line of code. Is anybody able to point out where I'm going wrong?

Oh, I'm using ADT2006 if that makes any difference.

whdjr

  • Guest
Re: vla-close help please.
« Reply #1 on: November 17, 2006, 11:35:27 AM »
Lisp doesn't open and close drawings very well.  To get better results use lisp to call a vba statement.  I don't have one handy but if you search on this forum you will find one.

whdjr

  • Guest
Re: vla-close help please.
« Reply #2 on: November 17, 2006, 11:44:04 AM »

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: vla-close help please.
« Reply #3 on: November 17, 2006, 11:22:02 PM »
You can close a drawing in that manner, however,  you should note that there are a couple of caveats. If you attempt to close the current drawing,  an error will be generated, also, if you close the drawing then attempt to perform an operation that relied upon any variables set in the noe closed drawing, an error will be generated.

Without having the specific code it will be hard to determine what the error is, but suffuce to say I have not been able to duplicate it.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

mr_nick

  • Guest
Re: vla-close help please.
« Reply #4 on: November 18, 2006, 03:01:52 PM »
The scenario is like this:

I have a drawing file open in the background - called 'temp.dwg' whilst my active drawing is where I am running the code from so there are no variables relied on from the drawing I want to close. If I copy and paste the line of code that I put in my first post the drawing closes no problem, exactly as I want it to. The problem is that whn I now try to do anything else - for eample if I type (strcat "123" "456"), I get presented with the error I showed. Every command I try to use gives me the same error and the only way out is to start a new session. I have now tried this on ADT2006, ABS2006 and ADT2007 all with the same result.

Having read a couple of the links that whdjr posted, I have now found that using:

(command "VBASTMT" (strcat "AutoCAD.Application.Documents.Item(\"temp.dwg\").Close") )

does exactly what I was trying to achieve and with no errors.

Thanks for your input chaps - it is much appreciated.