查看单个帖子
旧 2009-04-12, 10:18 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)