Grasshopper

algorithmic modeling for Rhino

 I'm trying to extract faces of a Brep in a C# script component, and I'm just having some issues with getting a result. I'm mainly having a problem with calling the DuplicateFace() method.

Can someone post some sample code of doing this in C#?

Views: 1691

Replies to This Discussion

Try this:

private void RunScript(Brep B, ref object A) 
{
List<Brep> faceList = new List<Brep>();
foreach (BrepFace surf in B.Faces) {
Brep faceBrep = surf.DuplicateFace(true);
faceList.Add(faceBrep);
}
A = faceList;
}
Thanks a lot for the example. I'm currently learning C# but I haven't gotten to doing Lists yet.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service