Skip to content

Instantly share code, notes, and snippets.

@luisdamed
Created April 7, 2023 18:23
Show Gist options
  • Save luisdamed/5a1c62ce0fe25426d53e3fe506941975 to your computer and use it in GitHub Desktop.
Save luisdamed/5a1c62ce0fe25426d53e3fe506941975 to your computer and use it in GitHub Desktop.
Create custom command for Simulink, allowing you to call addblocks.m from the Toolbox or using a combination of keys. See the explanation: https://www.makerluis.com/3-keyboard-macros-to-speed-up-your-simulink-workflow/
function sl_customization(cm)
cm.addCustomMenuFcn('Simulink:ToolsMenu', @getMyMenuItems);
end
function schemaFcns = getMyMenuItems(~)
schemaFcns = {@autoAddBlocks};
end
function schema = autoAddBlocks(~)
schema = sl_action_schema;
schema.label = 'Batch Add Blocks';
schema.statustip = 'Batch Add Blocks';
schema.accelerator = 'Ctrl+Shift+w';
schema.callback = @autoAddBlocksCS;
end
function autoAddBlocksCS (~)
addblocks
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment