几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   SolidWorks二次开发 (http://www.dimcax.com/hust/forumdisplay.php?f=111)
-   -   【转帖】saveas jpgstep on ondestroy (http://www.dimcax.com/hust/showthread.php?t=4897)

yang686526 2009-04-12 10:18 PM

【转帖】saveas jpgstep on ondestroy
 
saveas jpg/step/ on ondestroy
hi
can enyone help me.
i have written an api. i want to save my part/assembly/drawing in different formats just before the user is closing the document. i use the destroynotify event and the modeldoc2.saveas4. it is ok, if it is a .igs file, but if it is .jpg file then the file is generated and the resultkode is ok, but the file is empty.
if i make the same save in the savetostoragenotify event, then it is ok.
best regards
hanne vedel
cadsys
you shouldn't be calling any intensive or important functions in the ondestroy event handler as it is unsafe and your image will be blank because some of the handles and pointers to the document is probably destroyed at that point.
change your saving function to run on another event handler before it is destroyed.


所有的时间均为北京时间。 现在的时间是 08:06 AM.