In a python script, I am trying to change the current layer by using rs.CurrentLayer(‘mylayer’) .
During the first run of the script this works fine, however, on subsequent runs I get a message “str is not callable”. This happens also when I revert the Rhino file to the point where I ran the script the first time, and even if I use the script on a new drawing! (after closing the old drawing). The only way I can get it to work again is to quit Rhino and restart it.
Anybody any idea?
Edit: I found a solution. The root problem was in not using the right method to get back to the original current layer.