I've been doing some api programming. At the time I'm making a program simulating a milling curve in space. At the beginning of the program SolidWork run normal. After a while (app. after creating 25 sketches) SolidWorks slows down, and becomes even slower every time it creates more sketches. After having created 75 sketches, (it is always 75) SolidWorks send you a messagebox saying: "A required resource was " and that's it. It doesn't say what kind of problem SolidWorks have. After clicking the OK button, SolidWorks run pretty fast again. Until sometime it just exits my program without any message. I presume some sort of cache or something like it force this problem. It is not the UNDO list. I flush it without any differences.
Have someone of you had the same problem? If so, what did you do to resolve the problem. If not, do someone have an idea?
I'm no pro at this, but sounds like a memory leak. It may be SolidWorks or it may be your routine. You may want to review to make sure objects are being handled correctly, as a starting point.
Make sure any and all objects are set to NOTHING at the end of your program before it closes. This includes all document objects, feature opjects, application ("swApp"), etc.
first of all I want to mention that I write my programs in C#. I do not allocate any memory other than my local variables which are only "doubles" and only 18 of them. Below you will see my code:
PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.