.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

8 REPLIES 8
Reply
Message 1 of 9
pjones1
459 Views, 8 Replies

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

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

8 REPLIES 8
Message 2 of 9
pjones1
in reply to: pjones1

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

Message 3 of 9
pjones1
in reply to: pjones1

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)

Message 4 of 9
Balaji_Ram
in reply to: pjones1

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

Message 5 of 9
pjones1
in reply to: pjones1

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.

 

Message 6 of 9
Balaji_Ram
in reply to: pjones1

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

Message 7 of 9
pjones1
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

 

 

Message 8 of 9
Balaji_Ram
in reply to: pjones1

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

Message 9 of 9
pjones1
in reply to: pjones1

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

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost