Long story short, I loaded up a simple UI and then close it using deleteUI(). Try relaunching and this error occurs:
# Error: RuntimeError: Object's name 'newtab' is not unique. #
Here is the simple code I'm using.
import maya.cmds as mc
workspaceName = 'newtab'
if mc.workspaceControlState(workspaceName, exists=True):
mc.deleteUI(workspaceName)
def buildContent():
WinLayout = mc.columnLayout( adjustableColumn=True )
mc.button( label='Do Nothing' )
mc.button( label='Close', command=('mc.deleteUI(\"' + workspaceName + '\" )') )
mc.workspaceControl(workspaceName, uiScript = 'buildContent()', ttc=["Outliner",0])
Either there is a different way of doing this or I don't know how to use the workspacecontrolstate() and deleteUI().
Hello
I think you have to use the close flag under the workspaceControl command as well when deleting your UI.