algorithmic modeling for Rhino
//Return the table with all objects in the document
Rhino.Collections.ObjectTable table = RhinoDoc.ActiveDoc.Objects;
for(int i = 0; i < guids.Count; i++) //Loop through the Guids
{
Rhino.DocObjects.RhinoObject rho = table.Find(guids[i]);
rho.Attributes.Name = "Hello " + i.ToString(); //Sets the name
rho.CommitChanges();
}
//-------------------------------------------------------------
Rhino.DocObjects.ObjectEnumeratorSettings enumerator
= new Rhino.DocObjects.ObjectEnumeratorSettings();
enumerator.NameFilter = "Hello *";
//Setting here, for example, the lookup type (optional)
enumerator.ObjectTypeFilter =
Rhino.DocObjects.ObjectType.Point | Rhino.DocObjects.ObjectType.Curve;
foreach(Rhino.DocObjects.RhinoObject obj in table.GetObjectList(enumerator))
{
Print(string.Format("Found an object with name: {0}", obj.Attributes.Name));
}
I know this is an old quesion, and my questions might have something to do with updates in Grasshopper etc.
I get an error message
{0}
0. Error: The type or namespace name 'ObjectTable' does not exist in the namespace 'Rhino.Collections' (are you missing an assembly reference?) (line 72)
ObjectTable is the class that provides access to objects in a Rhino 3DM document. It is located in the Rhino.DocObjects.Tables namespace, not the Rhino.Collections namespace.
--
David Rutten
david@mcneel.com
Tirol, Austria
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