查看单个帖子
旧 2009-04-13, 10:17 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】destroynotify even

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
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)