- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm trying to write a script that copies over a base file x number of times and then sets different custom parameters in those files based on the file name. The script is here: https://gist.github.com/sent-hil/aa0c1f30abbf5b852de3cb348934c998
I'm using this following code to listen to file creation:
onDataFileComplete = MyDataFileCompleteHandler()
app.dataFileComplete.add(onDataFileComplete)
handlers.append(onDataFileComplete)
In the script MyDataFileCompleteHandler#notify does nothing but logs `args.file.name`. When I run the script I expect to see `MyDataFileCompleteHandler: <file name` 6 times, however, at times I'll see it 4 times or sometimes 5 times. As x increases, the chances of events being dropped increase. No matter how long I wait, the remaining onDataFileComplete are never fired.
I tried using `time.sleep` and `adsk.doEvents()` to let it complete, but that didn't help.
Bug in API perhaps? Would appreciate some help.
Thanks,
Senthil
Solved! Go to Solution.