- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
import adsk.core, adsk.fusion, adsk.cam, traceback def run(context): ui = None try: app = adsk.core.Application.get() ui = app.userInterface panel = ui.allToolbarPanels.itemById('SolidCreatePanel') separator_one = panel.controls.addSeparator('a_unique_id', 'PrimitivePipe', True) print(separator_one.id) separator_two = panel.controls.addSeparator('another_unique_id', 'PrimitivePipe', False) print(separator_two.id) except: if ui: ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
The code should add two separators next to the "Pipe" entry under the "Create" menu, but fails on two points.
1) The second separator is not created because there is already another separator below the "Pipe" entry.
2) The specified ids are not set correctly as the print statement returns (for example) 5d2cae42-c725-4269-b82e-b60c31d4ba50 and 83f39f92-0ef6-4afb-999a-2f9369402684 instead of 'a_unique_id' and 'another_unique_id'
Jérôme Briot, Freelance engineer - Mechanical design and prototyping
3D Print Plus / Pro | IDF Import | GitHub To Fusion 360 | Tube Bending Data Exchanger | Slice Data Export
Memory Used | Basic Calculator | Check Computer Specifications | Import spline from any CSV file
Solved! Go to Solution.