- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I am moving my scripts to plug in's and the snippet below works fine with the new command added to the Design-Solid-Create but I really want it in the Design-Surface-Create but am having a little confusion with this change. Is the correct parameter to alter the highlighted SolidCreatePanel or am I missing the boat and something else is required ? Thanks for your assistance and if you could point me to the correct file where I should have found this that would be helpful so I don't have to post in the future. Dozer
def run(context):
try:
global _app, _ui
_app = adsk.core.Application.get()
_ui = _app.userInterface
cmdDef = _ui.commandDefinitions.addButtonDefinition('adskSeaWolfHullDesignerPythonAddIn', 'SeaWolf Hull Designer', 'Creates a hull component', 'Resources/SeaWolf Hull Designer')
createPanel = _ui.allToolbarPanels.itemById('SolidCreatePanel')
hullButton = createPanel.controls.addCommand(cmdDef)
onCommandCreated = HullCommandCreatedHandler()
cmdDef.commandCreated.add(onCommandCreated)
_handlers.append(onCommandCreated)
Solved! Go to Solution.