You may want to disable every library link in your model. This could happen if:

• You are using a non-official version of your model that you would like to manipulate more easily
• You want to apply modifications to your entire model or a subsystem of your model programmatically

• How to find every block of your model
• How to modify its parameters

## Find Every Block of your Model

To do this, you can use the following command:

blocks = find_system(pathName, 'FollowLinks','on', 'BlockType', 'SubSystem');
• In this example, we use ‘FollowLinks’ set to ‘on’ in order to look inside the library blocks. We use ‘Subsystem’ because the ‘BlockType’ of a library block is necessarily a subsystem.
• pathName is the path that you want to start the search from. Most of the time it will be the root of your model, but that is not necessarily the case, so we will define the pathName as following:

pathName = gcb;
• gcb is merely the path of the block you clicked on. If you want to apply it to your model, you can change gcb to the name of your model.
• The variable “blocks” is a vector of cells; each cell contains the path of one of the subsystems of your model.

## Disable the Link of a Library Block

To disable the link of a library block, we will use the following command:

set_param(blockPath,'LinkStatus','inactive');

Then, we can apply this command iteratively to every block of your model as follows:

for i=1:length(blocks)
end
pathName = gcb;
end