Return variant control on choice within variant component
gets the variant control condition for the choice
expression = getCondition(
choice on the variant
variantComponent to choose the active variant choice. If the
condition is met on a variant choice, that variant choice becomes the active choice on the
Get Variant Control Condition
Create a model, get the root architecture, create one variant component, add two choices for the variant component, set a condition on one variant choice to choose the active variant choice, and get the condition.
model = systemcomposer.createModel("archModel"); systemcomposer.openModel("archModel"); arch = get(model,"Architecture"); mode = 1; variant = addVariantComponent(arch,"Component1"); compList = addChoice(variant,["Choice1","Choice2"]); setCondition(variant,compList(2),"mode == 2"); exp = getCondition(variant,compList(2))
exp = 'mode == 2'
A variant is one of many structural or behavioral choices in a variant component.
Use variants to quickly swap different architectural designs for a component while performing analysis.
A variant control is a string that controls the active variant choice.
Set the variant control to programmatically control which variant is active.
|Set Variant Control Condition|
Introduced in R2019a