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.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API Documentation mistake - positioning commands on menus using positionID

Message 1 of 2
154 Views, 1 Reply

API Documentation mistake - positioning commands on menus using positionID

On this doc page:


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.

Message 2 of 2
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

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