the flag: FirstTime

the flag: FirstTime

johnteng00
Advocate Advocate
277 Views
1 Reply
Message 1 of 2

the flag: FirstTime

johnteng00
Advocate
Advocate
Hi guys,

I try to add a menu item into the inventor UI. But I notice that the first time flag in the initialization function:

OnActivate (VARIANT_BOOL FirstTime)

is false (zero here) when I start the Inventor. Could anyone please tell me how this flag is set during the program start? I can't trace it with my debuger.

thanks
Eric
0 Likes
278 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

Inventor sets a registry value to indicate that it
has already started your add-in the first time.  It's possible to remove
this from the registry, but the easiest solution is to change the value of the
"Version" value of your add-in.  This is one of the values that your add-in
writes when it is registered.  This is the version of your add-in's user
interface.  When Inventor saves the flag indicating it already started your
add-in, it also saves the version value with the flag.  When it loads your
add-in it checks to see if it has already loaded it the first time and if the
current version of your add-in matches the version saved.  If the version
is different, Inventor will remove any user-interface your add-in created
previously and activate your add-in with FirstTime equal True so you can
recreate your user interface.
--
Brian Ekins
Autodesk Inventor API
Product Designer

href="http://blogs.autodesk.com/modthemachine">http://blogs.autodesk.com/modthemachine
0 Likes