Viewing referenced curve's layer

I have a referenced curve and I have 50+ layers, some switched off.

I would like to locate the layer of this referenced curve. i made a simple python script but it gives me the following error:

import rhinoscriptsyntax as rs
import scriptcontext
import Rhino
scriptcontext.doc = Rhino.RhinoDoc.ActiveDoc

print rs.ObjectLayer(x)

Runtime error (ValueErrorException): 53df4770-9c8d-4608-bb7d-a28c5c5b1c22 does not exist in ObjectTable

Traceback:
line 1065, in coercerhinoobject, “C:\Users\CWAI.RAMBOLL\AppData\Roaming\McNeel\Rhinoceros\7.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\utility.py”
line 910, in ObjectLayer, “C:\Users\CWAI.RAMBOLL\AppData\Roaming\McNeel\Rhinoceros\7.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\object.py”
line 7, in script

This expects an ID as an input. Right click on the x input, and set the Type Hint to Guid.

Hi Adam.
Thank you for your answer. it worked.
may i know a bit more about this? I have always confused about the object input in grasshopper.

Runtime error (ValueErrorException): 53df4770-9c8d-4608-bb7d-a28c5c5b1c22 does not exist in ObjectTable

what is this ObjectTable? and Does this objectTable not use GuID? when is it used otherwise?

My knowledge on this is a little limited, so hopefully someone can correct me if I am wrong.

I believe the ObjectTable would be a reference to all objects available in Rhino. When working with the default Python setup, with the type set to ghdoc Object (for use with rhinoscriptsyntax), I believe it creates its own ID which then wouldnt exist in Rhinos ObjectTable.

1 Like