|
doc change event question ?
here is the code in .net
what i want here is to close all forms if the currentdoc is a dwg and open forms if the currentdoc is a part or assembly
this function works fine except when i close all the documents, all forms are supposed to close because the statement "currentdoc is nothing"; howver, the forms are still open
thx for any help
chris
function sldworks_activemodeldocchangenotify() as integer
dim currentdoc as modeldoc2 = iswapp.activedoc
if currentdoc is nothing or currentdoc.gettype = swdocumenttypes_e.swdocdrawing then
closedforms()
else
openforms()
end if
end function
solidworks 2007 (office pro.) sp5.0
testing solidworks 2009 (pro) sp0.0
dell precision t3400
2 cpu (8500) 3.16 ghz, 3.25 gb of ram
window xp pro sp2
nvidia fx 570 6.14.11.6262
add a message box in the change function so you can tell when your code is running. i'm guessing it doesn't get called when the last document changes as it probably doesn't class it as a document change unless another document is becoming active
luke is right, you need to be sure the event is being triggered. perhaps closing all docs does not trigger the event.
you can also try using "debug.print" to send data to the immediate window. something like:
debug.print currentdoc.getpathname & " " & now
quick |
|