Scripting in GH Part 05

Software: 
Tag: 
Video Duration: 
9 minutes
Author: 
Zach Downey

In this tutorial we look at the foreach loop.  We create a list of points and loop through each point and create a circle of radius equal to one unit centered on each point.  

List<double> xpos = new List<double>();
foreach(Point3d pt in pts) {
    xpos.Add(pt.X);
}
A = xpos;
List<Circle> circles = new List<Circle>();
foreach(Point3d pt in pts) {
    Circle tempCircle = new Circle(pt, 1.0);
    circles.Add(tempCircle);
}
A = circles;

Rating

Please rate this tutorial below. Thanks.

5
Average: 4.5 (6 votes)

Want to Contribute?

Want to be an author? Drop us a line here we'd love to have you.

Already have a video you'd like to post? Send us a link and we'll get you going.

:)