Out of memory fatal error

Out of memory fatal error

andre_adc-dao
Advocate Advocate
560 Views
3 Replies
Message 1 of 4

Out of memory fatal error

andre_adc-dao
Advocate
Advocate

HI,

 

I'm developping a VBA macro (32 bits - AutoCAD 2010) that convert splines to 1 polyline. It is a form lines (courbes de niveau in French) drawing. There approximatively 10000 splines in the drawing. After converting about 3000 splines I've got a fatal error and AutoCAD close. I have 4Go of memory on Windows Vista, but I have the same problem in a virtual machines running Windows XP.

 

My routine convert a spline to pline and check if another spline is attached to. If so, I convert the spline to a pline and create a new polyline including the two previous one and I delete the first one (I try the add vertex method but it was so slow, I found the approach to recreate a new polyline faster). I take care to release each object to Nothing. I do that in loop until anymore spline is found. I revise my code many times and everything seems ok. When I run the routine on a smaller drawing, it works.

 

Anybody have an idea?

 

Regards,

 

André

 

0 Likes
561 Views
3 Replies
Replies (3)
Message 2 of 4

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

I would check in the Windows TaskManager how much memory AutoCAD used ... just to make sure that the error-message displays the right info.

Then I had often success switching undo to off before I start some heavy routines and I know I would not need an undo afterwards, look to UNDO (==> control ==> off, for details look >>>here<<<) for that ... but don't forget to switch it ON after having your work done.

Worst case, but possible, would be to do some modification, then close the drawing, open it and continue.

 

Good luck, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 3 of 4

andre_adc-dao
Advocate
Advocate

Thanks,

 

But disabling UNDO have no effects. I check memory and I found the code that cause the problem but I don't know why the memory is affected. The UNDO was a good thing to try.

 

The memory increase when I create the new polyline (including both previous one), but I deleted the two others, and the objects are set to Nothing after deletion and when the conversion of a complete polyline is done this objet is also set to Nothing.

 

I will continue to try to find a solution,

 

Regards,

 

André

 

0 Likes
Message 4 of 4

andre_adc-dao
Advocate
Advocate

Thank for your help Alfred,

 

I found a solution using...Autolisp. I would like to convert spline using pure VBA but it doesn't work, so I call a lisp routine. This routine create a selection set of spline and convert these objects to PLINE and join it using PEDIT. Some polylines are not join correctly, so I called my VBA routine to finish the job, but at this moment, the number of objects to process is smaller so I didn't have problem with memory and the time to process is OK.

 

Regards,

 

André

 

0 Likes