![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/175938/image.png)
Creation of Simulink Libraries
2 次查看(过去 30 天)
显示 更早的评论
Hello all
I have created a Simulink library but the library I created is linked to its block. I want to have it such a way that all the blocks which I am using in a model from this lib must be unlinked. So that any further change either in Model block or Library should not have any effect on each other.
It should be in such a way that it's block should be unlinked from the library the moment it is used in a model.
Hope to hear from you guys soon.
Best Regards
0 个评论
采纳的回答
Sebastian Castro
2015-4-8
编辑:Sebastian Castro
2015-4-8
Yes, you can do this.
When you drag a block in from a library, it essentially copies and pastes it into your new model. So, the key is to programmatically disable the library link when this block is copied.
To do this, you can right-click your block and go to Properties. Then, go to the Callbacks tab. Then, add the following line to your CopyFcn callback:
>> set_param(gcb,'LinkStatus','inactive');
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/175938/image.png)
Does this work?
- Sebastian
3 个评论
Sebastian Castro
2015-4-9
You can certainly nest libraries. If you drag a block from one library to another library other, it will preserve the original library link.
I'd be careful about doing this, though, because it makes you very prone to unwanted changes... although the "Resolve Links" dialog has gotten much better in the last few releases with regards to resolving multi-level library links.
- Sebastian
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!