Grasshopper

algorithmic modeling for Rhino

Hi,

How to group and ungroup objects using c#?

I would like to get the same output as group/ungroup components in grasshopper.

Thank you.

Views: 2888

Replies to This Discussion

Here's an example c# script that shows how to create a group: 

private void RunScript(List<GeometryBase> x, object y, ref object A)
{
GH_GeometryGroup grp = new GH_GeometryGroup();
var goos = x.Select(m => GH_Convert.ToGeometricGoo(m));
grp.Objects.AddRange(goos);
A = grp;

}

To "ungroup" just access the geometry group object's "Objects" collection. 

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service