def toggle_toolbargroup(rui, group): if not os.path.exists(rui) or not os.path.isfile(rui): return collection = rs.IsToolbarCollection(rui) if not collection: collection = rs.OpenToolbarCollection(rui) if rs.IsToolbar(collection, group, True): rs.ShowToolbar(collection, group) else: if rs.IsToolbar(collection, group, True): if rs.IsToolbarVisible(collection, group): rs.HideToolbar(collection, group) else: rs.ShowToolbar(collection, group)
from __future__ import print_function import rhinoscriptsyntax as rs import os import time name = "Deadline V-Ray DBR" if name not in rs.ToolbarCollectionNames(): file = "DEADLINEFILELOCATION" print(rs.OpenToolbarCollection(file)) rs.Command('-Toolbar T "%s" S "%s" Y Enter Enter' % (name, name)) else: print("Deadline V-Ray DBR toolbar already installed!") rs.Exit()