几何尺寸与公差论坛

 找回密码
 注册
查看: 617|回复: 0

【转帖】destroynotify even

[复制链接]
发表于 2009-4-13 10:17:52 | 显示全部楼层 |阅读模式
destroynotify event
hello, everyone,
i attached the "destroynotify" event to each opened part document. now i want to get modeldoc2 handle of the part document if it is being closed. but the event process function has no input argument. i don't know how to get the modeldoc2 handle.
please help.
newform
have you tried to get the active document? i'm not sure but i'd start by getting the current active document. i'm thinking that the document becomes active when the destroy notify event for the document fires.
hi, mattew,
thank you very much for your suggestion.
i had a try to get the active document. it works for most documents except the following case:
i opened a part document, say a, whose referenced part document, say b, is opened automatically by solidworks. the destroy event will be invoked twice if i close a. the handle of a will be obtained twice. however b remains opened. if i try to close b, the event will not be invoked. i cannot get handle of b.
is it because i didn't attach the event to the referenced document b, since b is opened by solidworks automatically?
edited: 09/11/2008 at 04:11 pm by newform newform
quick
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-24 09:50 , Processed in 0.036448 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表