I want to get the layer message of curve through c# code as following. But there is a problem that the “Rhino.Geometry.Curve” type cannot implicitly be converted to “Rhino.DocObjects.CurveObject”.
Please give me some suggestions. Any help is appreciated.
private void RunScript(List x, ref object A)
Rhino.DocObjects.CurveObject rhobj = x[i];
int index = rhobj.Attributes.LayerIndex;
string name = doc.Layers[index].Name;
private void RunScript(Guid id, ref object A)
var obj = RhinoDocument.Objects.Find(id);
A = RhinoDocument.Layers[obj.Attributes.LayerIndex];
Layer.gh (2.4 KB)
The code that you provided can work!
I have one more question about the method of “RhinoDocument.Objects.Find()”. I tried to find this method in RhinoCommon API document. Unfortunately, I cannont find this method. Could you give me some tips where I can get the message about RhinoDocument class in c#.
Thank you very much!
Are you looking for this?