Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

rs.CloseToolbarCollection() doesn't work in Rhino8

$
0
0

To be clear, in Rhino8, almost none of the toolbar commands that concern individual toolbars work (show, hide, isvisible, etc). However, most of the commands that concern toolbar collections do seem to work…but not this one (I haven’t tested all of them so there may be others that don’t work)

The underlying code in the toolbar.py file is below (with the documentation comment removed and two test print statements added)

def CloseToolbarCollection(name, prompt=False):
    tbfile = Rhino.RhinoApp.ToolbarFiles.FindByName(name, True)
    print(tbfile)
    if tbfile:
        print("we got here")
        return tbfile.Close(prompt)
    return False

I brought this function into my own py file, and passed the name of my toolbar collection to it. These were my results:

<Rhino.UI.ToolbarFile object at 0x0000000000000096 [Rhino.UI.ToolbarFile]>
we got here

So, it looks like I’m getting a valid ToolbarFile object, but its Close() method is not working for some reason. If you pass True to the prompt parameter, you even get the prompt asking if you want to close the toolbar file. But clicking Yes still doesn’t close the file.

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles