The functions you want are methods of the Variant Manager Application object.
IsVariantView: Checks if the main application is variant (or function) view.
GenerateVariantView: Generates a Variant View; ie puts the application into variant mode. You specify which variant to use for the view.
ResetView: Puts the application in the master view mode.
Look in the help under Application Object in the Variant Manager Automation Reference.
first, thank you for that Information. This sounds like a solution for me.
But on more question I have:
Now I tried to find an Information in the VM-Documentation, to get the the current Name of a Variant, if the Design is currently in the "VariantMode". Of course, I can Set and ResetView by myself with the VMC. But it would be also cool to know the Variant-Name, if a User had set the PCB to the VariantMode.
I have looked over the help files and also Intellisense within the IDE to see if there is a way to get the currently active variant, if there is one. I can't find anything anywhere that describes such a thing.
Thank you Patrick. With the VariantManagerControl I can do what I want.
But it is really very sad, that there is no way to find out an existing VariantView -Variantname! So I must reset the View if it was set, and set again, also when the View would be the correct one. (User might be think what does the programmer have done there!)