Show Block Name Toggle & Shortcut Key

版本 2.0.0 (3.1 KB) 作者: Mike Anthony
Adds a menu item and keyboard shortcut Ctrl+Shift+F to show/hide a block name.
1.3K 次下载
更新时间 2020/7/22

查看许可证

New Version!

Ever wish you could show or hide the name of the block without having to navigate to right-click->Format->Show Block Name?
This adds a custom menu item in the right-click Menu to toggle the state of the 'ShowName' and 'HideAutomaticName' properties of one or more selected blocks in your model.
More important, this assigns this function to the keyboard shortcut Ctrl+Shift+F. So now you just highlight the blocks and hit Ctrl+Shift+F to toggle the Show Block Name option!

The latest version fixes a few issues:

1. Auto show/hide name
In R2017b, the option to show a block's name had a 3rd option added: "Auto." This option automatically hides blocks with default block names (e.g. Gain1, In1, etc). The implementation of this created a new block property, HideAutomaticName, which needs to be considered in this shortcut. This function has been updated to toggle through the 3 options in this order:
- Auto
- On
- Off
Note: If you select multiple blocks, it will toggle each of them independently. For example, if block1 is currently Auto, and block2 is currently On, after toggling with the shortcut key block1 will be On and block2 will be Off.

2. Shortcut Key
Per the R2020a documentation, Ctrl+Shift+S has been assigned to a built-in function, save active referenced model (https://www.mathworks.com/help/simulink/ug/summary-of-mouse-and-keyboard-actions.html#butubxj). It's rarely a good idea to try to override built-in shortcuts, so the safer approach is to alter the shortcut key for this function. I have changed the shortcut to: Ctrl+Shift+F. Why did I choose this? Because I want to easily be able to trigger this shortcut with my left hand only, keeping my right hand on the mouse. If you prefer a different shortcut key, simply edit line 46 of the sl_customization file. Just be careful and be sure to check for conflicting assignments in Preferences->Keyboard->Shortcuts

引用格式

Mike Anthony (2024). Show Block Name Toggle & Shortcut Key (https://www.mathworks.com/matlabcentral/fileexchange/42224-show-block-name-toggle-shortcut-key), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2020a
与 R2017b 及更高版本兼容
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Modeling 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

ShowNameShortcut

版本 已发布 发行说明
2.0.0

See description for updated functionality.

1.1.0.0

This update fixes 2 bugs:
1. Does not hide toggle the show/hide name for the parent subsystem of a selected block(s)
2. Works for blocks under masks

1.0.0.1

Updated license

1.0.0.0