Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Drawing is Busy Error

1 REPLY 1
SOLVED
Reply
Message 1 of 2
Anonymous
1605 Views, 1 Reply

Drawing is Busy Error

I have seen quite a few posts on this subject, but none really fits my needs.  I've developed a routine that uses VL-LOAD-ALL to invoke what amounts to a script file in a series of drawings created by the routine.  The code looks like this:

 

(defun gmm->gis (/ tgt todo path dwgname)
  (vl-load-com)
  (vl-load-all "Executive List.lsp")
  (vl-bb-set 'twplist (setq todo (todo->list)))
  (uzfiles todo)
  (mapcar '(lambda (x)
      (setq path (strcat "c:\\program files\\wingmm\\work\\"
    (car x)
    "\\"
   )
     tgt (vla-add (vla-get-documents (vlax-get-acad-object))
     (strcat path dwgname ".dwg")
   )
      )
      (vla-saveas tgt (strcat path dwgname ".dwg"))
      (vla-close tgt)
    )
   todo
  )
)

 

The problem I'm having is that I keep getting an error of: ERROR: Automation Error. Drawing is busy when I hit the VLA-SAVEAS and VLA-CLOSE functions.  How can I test to see if the drawing is ready?

 

I'm concerned that I will run out of memory if I don't close them during the routine.  I could make a list of the drawings created and save/close them later, but how much later?  I think my solution lies in putting the routine in a wait-state until the drawing is ready and then saving and closing before creating the next drawing.

 

I've seen several methods posted that utilize VBA, but that's not an option since VBA is no longer distributed with AutoCAD.  I need to utilize the commands that come out of the box because My BASIC proramming skills atrophied long ago.

 

Thanks in advance for any help.

 

J Leavitt

1 REPLY 1
Message 2 of 2
pbejse
in reply to: Anonymous

J Leavitt

 

Conside using ObjectDBX

read the topic on the attached file

“Warp Speed, Captain!”

 

you'' be surprise how fast opening/editing files with ObjectDBX compared to script

 

I'm attaching the pdf file for your reference:

I've learn a lot from this article

 

Hope this helps Smiley Happy

 

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost