Debugging trick : copy guid to clipboard


(Willem Derks) #1

Hi,

I do a lot of pyhton scripting and oftentimes I have a script that while debugging halts/crashes Rhino while processing many objects. To find the culprit object I used to print the guid to the commandline. However from a frozen Rhino you cannot copy/paste let alone from a crashed one.

Today I realized I can put the guid on the clipboard before processing the object. Leaving the last guid on the clipboard to be used for selecting the object after opening the file again.

The code to store a guid ( or any other string on the clipboard):


import System

for obj in objs:
    System.Windows.Forms.Clipboard.SetText(str(obj))
    #do something tricky here

-Willem