Main Content

removeComponent

(Removed) Remove component from view

Since R2019b

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, and 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 Gallery to view the component.

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 Gallery.

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

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.

Data Types: char

Version History

Introduced in R2019b

collapse all

R2021a: removeComponent function has been removed

The removeComponent 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.