.NET

Reply
Valued Contributor
pjones
Posts: 52
Registered: ‎06-15-2007
Message 1 of 9 (290 Views)

Updated printing program to AutoCAD 2013 from 2011, program now crashes

290 Views, 8 Replies
02-26-2013 08:58 AM

We have a program that basically prints drawings to 11x17.  It worked perfectly in AutoCAD 2011.  I made the changes to how it opens the drawings as per the documentation for upgrading the program to 2013.  It works fine for the first two drawings but then AutoCAD just completely shuts down with no error message or anything.  I have tried to determine where the close happens by inserting messageboxes but have had no luck.

 

Some background on the program:

It is just a basic form with a timer.  When the timer reaches 0, it reads the drawing name from a file.  AutoCAD opens the drawing and prints it.  Then it closes the drawing, restets the timer and waits until it reaches 0.  SDI is set to 0 so closing the drawing should not affect it.  As I said, it has worked perfectly for years under 2011.  It is written in C#.

 

Any suggestions?

 

Patrick

Valued Contributor
pjones
Posts: 52
Registered: ‎06-15-2007
Message 2 of 9 (252 Views)

Re: Updated printing program to AutoCAD 2013 from 2011, program now crashes

02-27-2013 10:34 AM in reply to: pjones

Nevermind.  It seems that AutoCAD 2013 did not like running inside Visual Studio Express.  Which is a shame.

Valued Contributor
pjones
Posts: 52
Registered: ‎06-15-2007
Message 3 of 9 (248 Views)

Re: Updated printing program to AutoCAD 2013 from 2011, program now crashes

02-27-2013 11:06 AM in reply to: pjones

Well, I spoke to soon.  That worked great on my 64bit machine but when I recompiled it, after changing the references, for my 32 bit machine it is still crashing after just 2 drawings.  Anyone have any thoughts? (besideds just use the 64 bit because my plot servers are 32 bit)

ADN Support Specialist
Balaji_Ram
Posts: 699
Registered: ‎03-21-2011
Message 4 of 9 (190 Views)

Re: Updated printing program to AutoCAD 2013 from 2011, program now crashes

03-12-2013 04:56 AM in reply to: pjones

Hi Patrick,

 

Sorry for the delay.

 

It is hard to say what might be causing it to crash after two drawings.

 

If you still have the issue, can you please provide a trimmed down version of your sample project to reproduce the issue ?

 

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Valued Contributor
pjones
Posts: 52
Registered: ‎06-15-2007
Message 5 of 9 (184 Views)

Re: Updated printing program to AutoCAD 2013 from 2011, program now crashes

03-12-2013 05:45 AM in reply to: pjones

Thanks for the reply.  The routine uses the simple plot from through-th-interface (http://through-the-interface.typepad.com/through_the_interface/2007/09/driving-a-basic.html) with a few changes.  I can provide the whole thing if that will help but I have attached the 2 main parts.

 

For some reason it does not like me attaching either the .cs files or a zip file so I printed them to PDF.

 

ADN Support Specialist
Balaji_Ram
Posts: 699
Registered: ‎03-21-2011
Message 6 of 9 (169 Views)

Re: Updated printing program to AutoCAD 2013 from 2011, program now crashes

03-13-2013 04:30 AM in reply to: pjones

Hi Patrick,

 

I was reviewing the code that you shared. I couldnt find any obvious issues, but here are few things to check : 

 

1) Calling the "run_autocad()" that command inside the "Timer_Loop" can be problematic if you are not using the "System.Windows.Forms.Timer". Can you please try using a hidden form as explained in this blog post ?

http://adndevblog.typepad.com/autocad/2012/06/setting-up-a-timer-in-a-net-sample-that-uses-the-autoc...

 

2) Can you please try looping through a set of drawings in a "for" loop instead without the use of the timer and then call the "SimplePlot" method to do the plotting ? Does it crash after looping through two drawings ? This can help identify whether the issue is related with the timer or something to do with the actual plotting itself.

 

 

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Valued Contributor
pjones
Posts: 52
Registered: ‎06-15-2007
Message 7 of 9 (157 Views)

Re: Updated printing program to AutoCAD 2013 from 2011, program now crashes

03-13-2013 07:31 AM in reply to: Balaji_Ram

Thank you for the response.  As I said, this program was/is currently working for AutoCAD 2011 with no problems.  These problems did not start until I updated it to AutoCAD 2013 and the new core stuff.

 

The timer is a System.Windows.Forms.Timer.

 

I tested with the for loop.  I had it run through 4 drawings a few times.  Once the for loop finishes, AutoCAD completely shuts down and disappears.  It does that in both the debugger and when AutoCAD is run on its own.  I changed the program so that the loop is controlled by a button click.  I changed the loop to only do 2 drawings and it did fine the first time but crashed when I clicked the button a second time.  If I took the loop out and just had the button click do the "run_autocad" it crashed after the second drawing was printed. 

 

In the debugger, it shows "A first chance exception of type 'System.NotImplementedException' occured and that is has excited with code 0 (0x0).

 

Thanks,

 

Patrick

 

 

ADN Support Specialist
Balaji_Ram
Posts: 699
Registered: ‎03-21-2011
Message 8 of 9 (148 Views)

Re: Updated printing program to AutoCAD 2013 from 2011, program now crashes

03-13-2013 09:52 PM in reply to: pjones

I am sorry, it is difficult to say what might be causing it without reproducing it on my system.

 

If possible, can you please share a non-confidential buildable sample project for me to try and reproduce the same behavior ?

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Valued Contributor
pjones
Posts: 52
Registered: ‎06-15-2007
Message 9 of 9 (121 Views)

Re: Updated printing program to AutoCAD 2013 from 2011, program now crashes

03-20-2013 04:05 AM in reply to: pjones

Sorry it took me so long to get back to you.  There isn't anything confidential it is just very tailored for the way we work.  I will see what I can do and gladly upload it.  Thanks for your help.

 

Patrick

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.