Grasshopper

algorithmic modeling for Rhino

Hi all,

In rhino I have some circles with different diameters, with GH, how can i select only circles with diameter 1.00?

Thanks!

Views: 3113

Replies to This Discussion

Hi Dj,

Do you mean like this or using a script component?

Via C# script component: 

private void RunScript(double diameter, ref object circles)
{
Rhino.DocObjects.RhinoObject[] rhinoObj = Rhino.RhinoDoc.ActiveDoc.Objects.FindByObjectType(Rhino.DocObjects.ObjectType.Curve);

List<Rhino.Geometry.Circle> output = new List<Rhino.Geometry.Circle>();
foreach(Rhino.DocObjects.CurveObject obj in rhinoObj)
{
if (obj.CurveGeometry.IsCircle() == true)
{
Rhino.Geometry.Circle temp = new Rhino.Geometry.Circle(0);
obj.CurveGeometry.TryGetCircle(out temp);

if (temp.Diameter == diameter)
output.Add(temp);
}
}
circles = output;
}

It works!

Great! Which method were you looking for?

The first, the second does not work. Can you check the definition?

Thanks!

Attachments:

Here you go!

Attachments:

Super!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service