VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AutoCAD Startup Error

9 REPLIES 9
Reply
Message 1 of 10
Zirconium
2224 Views, 9 Replies

AutoCAD Startup Error

A little background: we have AutoCAD running a VBA .dvb file on a server that is constantly looking for files of a specific type to process. If this specific file contains the word 'STOP', the current drawings are closed and SendCommand('Quit ') is executed. The problem occurs after autocad has been exited and a new instance is started (by a monitoring service/process). After AutoCAD exits & is re-opened for the 32nd time, i get the following error: (see attachment)

AutoCAD Startup Problem

There are already the maximum of 32 sessions of AutoCAD running.


Why does autocad think there are so many sessions? All of the previous sessions closed by themselves and there is always only 1 running instance in Task Manager.

Any Ideas???
9 REPLIES 9
Message 2 of 10
Anonymous
in reply to: Zirconium

Where is this popup message from? The service process or AutoCAD itself? I'd bet it is from the service process (it may even have a built-in setting that limits the instances of AutoCAD on the server to avoid resources running out). Depending on how AutoCAD is automated, the possible reason could be whenever an instance is launched, an AcadApplication variable is set. Since the instance is terminated the "SendCommand('Quit')", the Acad Instance is gone while the AcadApplication variable may still live in the process. Depending on how the process counts the number of instance, it may give this popup message. If AutoCAD is automated through ActiveX, it is not good way to terminate Acad instance by using "Sendcommand", it should be done with AcadApplication.Quit() method. It is also very possible the way the service keeps instance count is designed wrong. "Zirconium" wrote in message news:19203899.1096484848472.JavaMail.jive@jiveforum1.autodesk.com... > A little background: we have AutoCAD running a VBA .dvb file on a server that is constantly looking for files of a specific type to process. If this specific file contains the word 'STOP', the current drawings are closed and SendCommand('Quit ') is executed. The problem occurs after autocad has been exited and a new instance is started (by a monitoring service/process). After AutoCAD exits & is re-opened for the 32nd time, i get the following error: (see attachment) > > AutoCAD Startup Problem > > There are already the maximum of 32 sessions of AutoCAD running. > > > Why does autocad think there are so many sessions? All of the previous sessions closed by themselves and there is always only 1 running instance in Task Manager. > > Any Ideas???
Message 3 of 10
Zirconium
in reply to: Zirconium

The service is simply a VB application that uses CreateProcess API to launch autocad with a /b startup parameter. If the service needs to terminate a process of autocad, the file with the 'STOP' command is placed in the specific processing directory and runs the WaitForSingleObject API to wait for the instance to terminate and then releases any handles it had on the process.

The message is not comming from the service, but from AutoCAD itself.

What should I look into about AutoCAD application variables that might be set to an incorrect value?
Message 4 of 10
Anonymous
in reply to: Zirconium

Look on the process tab of task manager, and see if AutoCAD is really closing or not. -- http://www.caddzone.com AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005 http://www.acadxtabs.com "Zirconium" wrote in message news:19203899.1096484848472.JavaMail.jive@jiveforum1.autodesk.com... >A little background: we have AutoCAD running a VBA .dvb file on a server >that is constantly looking for files of a specific type to process. If this >specific file contains the word 'STOP', the current drawings are closed and >SendCommand('Quit ') is executed. The problem occurs after autocad has been >exited and a new instance is started (by a monitoring service/process). >After AutoCAD exits & is re-opened for the 32nd time, i get the following >error: (see attachment) > > AutoCAD Startup Problem > > There are already the maximum of 32 sessions of AutoCAD running. > > > Why does autocad think there are so many sessions? All of the previous > sessions closed by themselves and there is always only 1 running instance > in Task Manager. > > Any Ideas???
Message 5 of 10
Anonymous
in reply to: Zirconium

OK, try to do a little revision in the DVB file, where SendCommand is called, to see what happens. You may have code like ThisDrawing.SendCommand "Quit" Change it to Dim app as AcadApplication Set app=ThisDrawing.Application ThisDrawing.Close False ' or True to save app.Quit "Zirconium" wrote in message news:13499008.1096490725172.JavaMail.jive@jiveforum1.autodesk.com... > The service is simply a VB application that uses CreateProcess API to launch autocad with a /b startup parameter. If the service needs to terminate a process of autocad, the file with the 'STOP' command is placed in the specific processing directory and runs the WaitForSingleObject API to wait for the instance to terminate and then releases any handles it had on the process. > > The message is not comming from the service, but from AutoCAD itself. > > What should I look into about AutoCAD application variables that might be set to an incorrect value?
Message 6 of 10
Zirconium
in reply to: Zirconium

Thanks for the suggestion.

I will try that and see how it goes tomorrow.
Message 7 of 10
Zirconium
in reply to: Zirconium

I made the suggested change and it made no difference. I still get the same error message on the opening of the supposed 33rd instance. I found a possible reason...in the VB Monitor app, it is supposed to wait for a specific autocad instance to close (using WaitForSingleObject) and then restart it shortly later. For some reason, WaitForSingleObject will timeout even though AutoCAD already exited. Could this be causing my problem? Any ideas???
Message 8 of 10
Zirconium
in reply to: Zirconium

Yes, that was the first thing I tried. There are no listed instances of acad.exe.
Message 9 of 10

Hi! Smiley Happy

I also have a similar case with ACA, however I know nothing about programming (APIs), scripts, etc.  I'm just wondering if you have already solved this... mind sharing?  Thanks.

 

Message 10 of 10
congcd4
in reply to: ShellsoftAutodesk

I just wondering why AutoDesk Expert don't fix this stupid error?

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

Post to forums  

Autodesk Design & Make Report

”Boost