algorithmic modeling for Rhino
Hiya,
I have a list of curves (polylines) that are input into a C# Script component. The script is attempting to change the layer of each curve. However, in order change the layer of the curve a Rhino.DocObjects.RhinoObject reference is needed. The only method I can see to locate the curve is the RhinoDoc.Objects.Find(GUID) method. How do I get the GUID for the curve ? Alternatively, is there a different way of obtaining the RhinoObject reference apart from Find(GUID) ?
private void RunScript(List<Polyline> TopoPlates, object y, ref object A)
{
// Sort topo plates based on Z values.
List<Polyline> sortedList = TopoPlates.OrderBy(p => p.Last.Z).ToList();
foreach(Polyline pline in TopoPlates)
{
// Get Z value
int zValue = (int) (pline.Last.Z);
Print("Z Value: " + zValue);
// Check if layer with Z value exists. Create new layer if not.
RhinoDoc doc;
doc = RhinoDoc.ActiveDoc;
int layerIndex = doc.Layers.Find("" + zValue + " m", true);
if( layerIndex < 0 )
{
Layer nLayer = new Layer();
nLayer.Name = "" + zValue + " m";
doc.Layers.Add(nLayer);
layerIndex = doc.Layers.Find("" + zValue + " m", true);
}
Print("Layer Index:" + layerIndex);
// HELP!!!
Rhino.DocObjects.RhinoObject plineObj = doc.Objects.Find( /* How do I get the GUID */ );
Tags:
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by