Main Content

addComponent

(Removed) Add component to view given path

Since R2019b

The addComponent function has been removed. You can create a view using the createView function and add a component using the addElement function. For further details, see Compatibility Considerations.

Description

example

viewComp = addComponent(object,compPath) adds the component with the specified path.

addComponent is a method for the class systemcomposer.view.ViewArchitecture.

Examples

collapse all

Create a model, extract its architecture, and add three components.

model = systemcomposer.createModel('mobileRobotAPI');
arch = model.Architecture;
components = addComponent(arch,{'Sensor','Planning','Motion'});

Create a view architecture, a view component, and add a component. Open the Architecture Views Gallery to view the component.

view = model.createViewArchitecture('NewView');
viewComp = fobSupplierView.createViewComponent('ViewComp');
viewComp.Architecture.addComponent('mobileRobotAPI/Motion');
openViews(model);

Input Arguments

collapse all

View architecture, specified as a systemcomposer.view.ViewArchitecture object.

Path to component, including the name of the top-level model, specified as a character vector.

Example: 'mobileRobotAPI/Motion'

Data Types: char

Output Arguments

collapse all

View component, returned as a systemcomposer.view.ViewComponent object.

Version History

Introduced in R2019b

collapse all

R2021a: addComponent function has been removed

The addComponent function is removed in R2021a with the introduction of new views APIs. For more information on how to create and edit a view programmatically, see Create Architecture Views Programmatically.