Visual Basic Customization

Visual Basic Customization

Reply
Contributor
Zirconium
Posts: 13
Registered: ‎07-26-2002
Message 1 of 10 (724 Views)

AutoCAD Startup Error

724 Views, 9 Replies
09-29-2004 12:06 PM
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???
*Norman Yuan
Message 2 of 10 (724 Views)

Re: AutoCAD Startup Error

09-29-2004 12:40 PM 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???
Contributor
Zirconium
Posts: 13
Registered: ‎07-26-2002
Message 3 of 10 (724 Views)

Re: AutoCAD Startup Error

09-29-2004 01:44 PM 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?
*Tony Tanzillo
Message 4 of 10 (724 Views)

Re: AutoCAD Startup Error

09-29-2004 04:34 PM 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???
*Norman Yuan
Message 5 of 10 (724 Views)

Re: AutoCAD Startup Error

09-29-2004 05:17 PM 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?
Contributor
Zirconium
Posts: 13
Registered: ‎07-26-2002
Message 6 of 10 (724 Views)

Re: AutoCAD Startup Error

09-30-2004 12:12 PM in reply to: Zirconium
Thanks for the suggestion.

I will try that and see how it goes tomorrow.
Contributor
Zirconium
Posts: 13
Registered: ‎07-26-2002
Message 7 of 10 (724 Views)

Re: AutoCAD Startup Error

10-04-2004 07:59 AM 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???
Contributor
Zirconium
Posts: 13
Registered: ‎07-26-2002
Message 8 of 10 (724 Views)

Re: AutoCAD Startup Error

10-04-2004 07:59 AM in reply to: Zirconium
Yes, that was the first thing I tried. There are no listed instances of acad.exe.
Valued Contributor
ShellsoftAutodesk
Posts: 50
Registered: ‎09-20-2007
Message 9 of 10 (633 Views)

Re: AutoCAD Startup Error

06-18-2012 09:02 PM in reply to: Zirconium

Hi! :smileyhappy:

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.

 

Member
congcd4
Posts: 3
Registered: ‎06-06-2014
Message 10 of 10 (85 Views)

Re: AutoCAD Startup Error

09-04-2014 04:56 AM in reply to: ShellsoftAutodesk

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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.