Macro Memory Resources Problem

Hi,

I have written a macro that change parameters in different part in an assembly and then create DXF files.

But Solidworks or Windows 7 show my an error (system resources are insufficient) and then Solidworks close automatically.

The macro work in this way:

  1. open the assembly
  2. open a part
  3. change parameter in a configuration
  4. save the DXF
  5. close the part
  6. Repeat the operations (points 2-5) 40 times.

I take a look in the memory usage and I notice that Solidworks increase the memory usage until more and less 1GB than it show me the message.

My workstation have 8GB of RAM and 500GB HD free, Video NVIDIA Quadro FX 580 512MB, Windows 7 - 64Bit, no Antivirus.

Why the system or Solidworks show me this error (system resources are insufficient)?

Thanks

SolidworksApi macros