system.perspective.alterDock parameters

Hi everyone!

I’ve started experimenting a bit with alterDock function that was newly added.

In the manual system.perspective.alterDock it says that parameters are keyword arguments. but I’m thinking “JSON” since it’s what I’m used to.

So, this line worked for me: system.perspective.alterDock(dockName, { 'size': 800 } ) which is slightly different from what the manual shows. For parameters I wrote system.perspective.alterDock(dockName, { 'viewParams': {'tank: '01'} } )

How should it be written?

system.perspective.alterDock(dockName, { 'viewParams': {'tank: '01'} } )

Looks close to being correct (assuming dockName is a variable which stores the ID of the Docked View), though you’re missing a closing quote after tank:

system.perspective.alterDock(dockName, { 'viewParams': {'tank': '01'} } )

I’ll reach out to the Docs team to update that example with the correct usage.

I had some code around in an many parameters so I simplify it and forgot to add that quote. dockName is a string with the name of the dock. Just dockName = 'my dock name'

My dock name in that scenario is quite long so it’s better to have it in a variable.

Going back to the manual, why it’s { size: 500 } instead of { 'size': 500 }?

It IS supposed to be "size". The docs are wrong.