function renameLibLinks(mdl,origLibBlockName,newLibBlockName)
system = load_system(mdl);
origRefBlock = ['mbdriLib/',origLibBlockName,'.*'];
newRefBlock = ['mbdriLib/',newLibBlockName];
blocks = find_system(system,'FollowLinks','on',...
'LookUnderMasks','on',...
'RegExp','on',...
'LinkStatus','resolved',...
'ReferenceBlock',origRefBlock);
set_param(mdl, 'LockLinksToLibrary', 'off')
for i=1:numel(blocks)
set_param(blocks(i),'ReferenceBlock',newRefBlock);
end
end
0 Comments
Sign in to comment.