getActiveChoice - Get active choice on variant component - MATLAB (original) (raw)

Main Content

Get active choice on variant component

Syntax

Description

[choice](#mw%5F06769cec-e6bc-43d8-9e69-83cca459db14) = getActiveChoice([variantComponent](#mw%5F4e49152f-ec8e-4f21-b04b-baeaf136ce56%5Fsep%5Fmw%5Fdc134891-6ed2-4ed7-8511-0d8e13eb5044)) finds which choice is active for the variant component.

example

Examples

collapse all

Create a model, get the root architecture, create one variant component, add two choices for the variant component, set the active choice, and get the active choice.

model = systemcomposer.createModel("archModel"); systemcomposer.openModel("archModel"); arch = get(model,"Architecture"); variant = addVariantComponent(arch,"Component1"); compList = addChoice(variant,["Choice1","Choice2"]); setActiveChoice(variant,compList(2)); comp = getActiveChoice(variant)

comp = Component with properties:

 IsAdapterComponent: 0
       Architecture: [1×1 systemcomposer.arch.Architecture]
               Name: 'Choice2'
             Parent: [1×1 systemcomposer.arch.Architecture]
              Ports: [0×0 systemcomposer.arch.ComponentPort]
         OwnedPorts: [0×0 systemcomposer.arch.ComponentPort]
  OwnedArchitecture: [1×1 systemcomposer.arch.Architecture]
         Parameters: [0×0 systemcomposer.arch.Parameter]
           Position: [15 15 65 76]
              Model: [1×1 systemcomposer.arch.Model]
     SimulinkHandle: 221.0005
SimulinkModelHandle: 153.0002
               UUID: '8d71e26a-eabf-4ab2-a0e0-3d06ef0111c0'
        ExternalUID: ''

Input Arguments

Output Arguments

More About

collapse all

Term Definition Application More Information
Variant 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. Create Variants
Variant control A variant control is a string that controls the active variant choice. Set the variant control programmatically to control which variant is active. Set Variant Control Condition

Version History

Introduced in R2019a

See Also

Blocks

Objects

Functions

Topics