Main Content

removeComponent

(Removed) Remove component from view

The removeComponent function has been removed. You can create a view using the createView function with a selection query, remove the query using the removeQuery function keeping the contents, and then remove a component using the removeElement function. For further details, see Compatibility Considerations.

Description

example

removeComponent(object,compPath) removes the component with the specified path.

removeComponent is a method from 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 editor to see it.

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

Remove the component from the view and check the architecture views editor.

viewComp.Architecture.removeComponent('mobileRobotAPI/Motion');

Input Arguments

collapse all

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

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

Data Types: char

Compatibility Considerations

expand all

Errors starting in R2021a

Introduced in R2019b