Hi Kevin
It would take a bit of work to strip down my code to the point where I could post it here, so let me explain exactly what I did.
For a while, all of my add-ins were being used via the menu system, and when needed, I would open a dialog or two, and for lengthy operations, do that in a thread so that a user is not locked out of EA while the operation takes place. Initially, I was happy with that, not knowing any better. But the use of the context sensitive menu to access add-in functionality began to irk me. The menu lag sometimes was troublesome, even though I did all I can to reduce it, but when you have a lot of add-ins...argh. So, I decided to try this ActiveX thing.
I designed a custom control in VS.Net with loads of buttons and other controls on it to execute my add-in's functions. I also created a dialog form and put the custom control on it. The only two menu options in my addin were to either open the dialog form, or put the custom control in EA's dialog frame using the AddTab() automation function. Then, you can run the functions of the add-in in either way to compare the performance. The difference was very noticable.
At the time, my document generation processing was just parsing EA model data and printing diagnostics to the output tab, not actually generating a document. The algorithm for parsing the model was something like (with all extraneous detail removed):
function parse-document-model is
call parse-package, passing in the document-model package
function parse-package is
print package diagnostics
for each diagram in package
print diagram diagnostics
for each sub-package in package
call parse-package (ie. recurse)
for each element in package
call parse-element
funtion parse-element is
print element diagnostics
for each subElement in element
call parse-element (ie. recurse)
If I find time I will try and post some code. to demonstrate this. Give me a week or so.
