├── demo.png ├── isolate ├── 16x16.png ├── 32x32.png ├── 64x64.png ├── 16x16-normal.png ├── 32x32-normal.png ├── 16x16-disabled.png └── 32x32-disabled.png ├── unisolate ├── 16x16.png ├── 32x32.png ├── 64x64.png ├── 16x16-disabled.png └── 32x32-disabled.png ├── findinbrowser ├── 16x16.png ├── 32x32.png ├── 64x64.png ├── 16x16-disabled.png └── 32x32-disabled.png ├── DumpCmdDefs ├── DumpCmdDefs.manifest └── DumpCmdDefs.py ├── ShortcutItPy.manifest ├── LICENSE ├── ShortcutItPy.py └── README.md /demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lf-/ShortcutItPy/HEAD/demo.png -------------------------------------------------------------------------------- /isolate/16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lf-/ShortcutItPy/HEAD/isolate/16x16.png -------------------------------------------------------------------------------- /isolate/32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lf-/ShortcutItPy/HEAD/isolate/32x32.png -------------------------------------------------------------------------------- /isolate/64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lf-/ShortcutItPy/HEAD/isolate/64x64.png -------------------------------------------------------------------------------- /unisolate/16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lf-/ShortcutItPy/HEAD/unisolate/16x16.png -------------------------------------------------------------------------------- /unisolate/32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lf-/ShortcutItPy/HEAD/unisolate/32x32.png -------------------------------------------------------------------------------- /unisolate/64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lf-/ShortcutItPy/HEAD/unisolate/64x64.png -------------------------------------------------------------------------------- /findinbrowser/16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lf-/ShortcutItPy/HEAD/findinbrowser/16x16.png -------------------------------------------------------------------------------- /findinbrowser/32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lf-/ShortcutItPy/HEAD/findinbrowser/32x32.png -------------------------------------------------------------------------------- /findinbrowser/64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lf-/ShortcutItPy/HEAD/findinbrowser/64x64.png -------------------------------------------------------------------------------- /isolate/16x16-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lf-/ShortcutItPy/HEAD/isolate/16x16-normal.png -------------------------------------------------------------------------------- /isolate/32x32-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lf-/ShortcutItPy/HEAD/isolate/32x32-normal.png -------------------------------------------------------------------------------- /isolate/16x16-disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lf-/ShortcutItPy/HEAD/isolate/16x16-disabled.png -------------------------------------------------------------------------------- /isolate/32x32-disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lf-/ShortcutItPy/HEAD/isolate/32x32-disabled.png -------------------------------------------------------------------------------- /unisolate/16x16-disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lf-/ShortcutItPy/HEAD/unisolate/16x16-disabled.png -------------------------------------------------------------------------------- /unisolate/32x32-disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lf-/ShortcutItPy/HEAD/unisolate/32x32-disabled.png -------------------------------------------------------------------------------- /findinbrowser/16x16-disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lf-/ShortcutItPy/HEAD/findinbrowser/16x16-disabled.png -------------------------------------------------------------------------------- /findinbrowser/32x32-disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lf-/ShortcutItPy/HEAD/findinbrowser/32x32-disabled.png -------------------------------------------------------------------------------- /DumpCmdDefs/DumpCmdDefs.manifest: -------------------------------------------------------------------------------- 1 | { 2 | "autodeskProduct": "Fusion360", 3 | "type": "script", 4 | "author": "", 5 | "description": { 6 | "": "" 7 | }, 8 | "supportedOS": "windows|mac", 9 | "editEnabled": true 10 | } -------------------------------------------------------------------------------- /ShortcutItPy.manifest: -------------------------------------------------------------------------------- 1 | { 2 | "autodeskProduct": "Fusion360", 3 | "type": "addin", 4 | "id": "6afb2960-7009-4112-9764-8ec2233fa6b3", 5 | "author": "lf", 6 | "description": { 7 | "": "Add a bunch of commands to a toolbar panel in Tools so they can be shortcut" 8 | }, 9 | "version": "0.1", 10 | "runOnStartup": false, 11 | "supportedOS": "windows|mac", 12 | "editEnabled": true 13 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 lf 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /DumpCmdDefs/DumpCmdDefs.py: -------------------------------------------------------------------------------- 1 | import adsk.core, adsk.fusion, traceback 2 | 3 | # This is based on a sample from the Autodesk knowledgebase which is under 4 | # an unknown license. Trivial portions of it have been kept, and my contributions 5 | # are licensed under the MIT license of the parent project. 6 | 7 | # The sample is available at https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-d2b85a7e-fd08-11e4-9e07-3417ebd3d5be 8 | # which is titled "Write user interface to a file API sample" 9 | 10 | def reprCmdDef(cmdDef): 11 | return """ 12 | id = {o.id} 13 | name = {o.name!r} 14 | """.format(o=cmdDef) 15 | 16 | def run(context): 17 | ui = None 18 | try: 19 | app = adsk.core.Application.get() 20 | ui = app.userInterface 21 | 22 | fileDialog = ui.createFileDialog() 23 | fileDialog.isMultiSelectEnabled = False 24 | fileDialog.title = "Specify result filename" 25 | fileDialog.filter = 'Text files (*.txt)' 26 | fileDialog.filterIndex = 0 27 | dialogResult = fileDialog.showSave() 28 | if dialogResult == adsk.core.DialogResults.DialogOK: 29 | filename = fileDialog.filename 30 | else: 31 | return 32 | 33 | result = 'Command defs:' 34 | for cmdDef in ui.commandDefinitions: 35 | result += reprCmdDef(cmdDef) + '\n' 36 | 37 | output = open(filename, 'w') 38 | output.writelines(result) 39 | output.close() 40 | 41 | ui.messageBox('File written to "' + filename + '"') 42 | except: 43 | if ui: 44 | ui.messageBox('Failed:\n{}'.format(traceback.format_exc())) 45 | -------------------------------------------------------------------------------- /ShortcutItPy.py: -------------------------------------------------------------------------------- 1 | #Author-lf 2 | #Description-Add a bunch of commands to a toolbar panel in Tools so they can be shortcut 3 | 4 | import adsk.core, adsk.fusion, adsk.cam, traceback 5 | 6 | def run(context): 7 | ui = None 8 | try: 9 | app = adsk.core.Application.get() 10 | ui = app.userInterface 11 | 12 | ws = ui.workspaces.itemById('FusionSolidEnvironment') 13 | panels = ws.toolbarPanels 14 | myPanel = panels.itemById('ShortcutItPanel') 15 | if myPanel: 16 | myPanel.deleteMe() 17 | 18 | myPanel = panels.add('ShortcutItPanel', 'Shortcut It', '') 19 | needCmdDefs = ( 20 | ('IsolateCmd', './isolate'), 21 | ('UnisolateCmd', './unisolate'), 22 | ('UnisolateAllCmd', './unisolate'), 23 | ('FindInBrowser', './findinbrowser'), 24 | ('FindInWindow', './findinbrowser'), 25 | ('SetOrbitCenterCommand', None), 26 | ('ResetOrbitCenterCommand', None), 27 | ('SoftDeleteCommand', None), 28 | ) 29 | for cmdName, resDir in needCmdDefs: 30 | cmd = ui.commandDefinitions.itemById(cmdName) 31 | if not cmd: 32 | ui.messageBox('Cannot find {}'.format(cmdName)) 33 | continue 34 | if resDir is not None: 35 | cmd.resourceFolder = resDir 36 | cmd.controlDefinition.isVisible = True 37 | cmd.controlDefinition.isEnabled = True 38 | myPanel.controls.addCommand(cmd) 39 | 40 | except: 41 | if ui: 42 | ui.messageBox('Failed:\n{}'.format(traceback.format_exc())) 43 | 44 | def stop(context): 45 | ui = None 46 | try: 47 | app = adsk.core.Application.get() 48 | ui = app.userInterface 49 | ws = ui.workspaces.itemById('FusionSolidEnvironment') 50 | panels = ws.toolbarPanels 51 | myPanel = panels.itemById('ShortcutItPanel') 52 | if myPanel: 53 | myPanel.deleteMe() 54 | 55 | except: 56 | if ui: 57 | ui.messageBox('Failed:\n{}'.format(traceback.format_exc())) 58 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ShortcutItPy 2 | 3 | # /!\ This add-in is not actively maintained because I don't use Fusion /!\ 4 | 5 | It probably still works simply because it's not doing anything complicated. I can't 6 | really help with anything except what I remember because I can't run Fusion on my 7 | computer. 8 | 9 | -------------- 10 | 11 | This small add-in for Fusion 360 adds icons to some commands and puts them in 12 | a panel so you can add shortcuts for them. 13 | 14 | How to install it: https://knowledge.autodesk.com/support/fusion-360/troubleshooting/caas/sfdcarticles/sfdcarticles/How-to-install-an-ADD-IN-and-Script-in-Fusion-360.html 15 | 16 | ![demo image](demo.png) 17 | 18 | Currently the commands include: 19 | - Isolate 20 | - Unisolate 21 | - Unisolate All 22 | - Find in Browser (the add-in must be re-run after startup to list this, 23 | not sure why. The shortcut stays across startups though so it's not a 24 | problem) 25 | - Find in Window (NOTE: both Find in Window and Find in Browser seem to only 26 | appear once a context menu containing them has been opened) 27 | - Remove 28 | - Activate Component 29 | - Set Orbit Center 30 | - Reset Orbit Center 31 | 32 | If you want me to add another, please file an issue on this repository or make 33 | a pull request to add it. 34 | 35 | ## Contributing 36 | Thanks for the interest in this repository! To add a command, first find its 37 | name. I ship a script in DumpCmdDefs/ which can do this. Copy this directory 38 | into your Scripts folder and run the script. It will dump out all the commands 39 | with their internal IDs to a txt file. 40 | 41 | Once you have found the command you want to add, include it in the `needCmdDefs` 42 | tuple in `ShortcutItPy.py`. This tuple is formatted in the following format: 43 | `(CommandName, IconsDir)`. Commands need to have icons so the shortcut 44 | option is shown. If a command already has an icon, simply put `None` in place of 45 | the `IconsDir` as we don't need to add one. 46 | 47 | Stop and start the extension in Fusion, then try the command. Not every command 48 | will actually work if you put it in a menu unfortunately. If it works, please 49 | commit it and send it in as a pull request! I'd love to see what is useful to 50 | you. 51 | 52 | ### Legal 53 | 54 | The iconography used is Adwaita from the GNOME project. It is licensed under 55 | either LGPLv3 or CC-BY-SA, and so are my modifications. 56 | 57 | The code in this project is licensed under the MIT license unless otherwise 58 | specified in the file header. 59 | --------------------------------------------------------------------------------