Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API Documentation mistake - positioning commands on menus using positionID

1 REPLY 1
SOLVED
Reply
Message 1 of 2
OceanHydroAU
154 Views, 1 Reply

API Documentation mistake - positioning commands on menus using positionID

On this doc page: https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-F31C76F0-8C74-4343-904C-68FDA9BB8B4C

 

it has this example:-

 

# Get the control for the 3D Print command.
print3DCmd = fileDropDown.controls.itemById('ThreeDprintCmdDef')

# Add a new button next to the 3D Print control.
buttonControl = fileDropDown.controls.addCommand(testCommandDef, 'testCmdDefControl', print3DCmd.index) 

 

the ".index" parameter is wrong - that returns a int, but that parameter ("positionID") is a string and is not expecting a number.

 

print3DCmd.index should be 'ThreeDprintCmdDef'

 

Your website does not seem to support searching for "and" terms, so I was unable to find if other places in your doc are using ".index" wrongly  ("addCommand" returns 46 results, but "addCommand .index" returns 400+...).  Google does not have your help indexed, so I could not use that either.

 

It would be worth checking if other places have the same wrong info, if you know how to search.

 

The same "Doc mistake" applies equally to the addDropDown method - it wants an ID, not an index.

1 REPLY 1
Message 2 of 2
BrianEkins
in reply to: OceanHydroAU

Thank you for reporting this.  It's likely that the documentation you found the error in was written during the design and implementation phase and things changed before it was finished but the documentation wasn't checked and updated.  This is likely the only place where this specific error occurs.  In the actual samples, they've been run and tested so they would have failed if they contained this same error.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report