Grasshopper

algorithmic modeling for Rhino

Hey guys

I've been trying to resolve several problems today in trying to figure out how to use Rhino.Geometry. 

When I get to trying to pass the lofted surface out which I have created, I get the error, "expected Brep, got Array[Brep]". Am I supposed to unpack this further, or what am I doing wrong?

File attached below.

Thanks

Views: 939

Attachments:

Replies to This Discussion

Yes, Loft may generate a collection of breps if something goes wrong and there's a gap in the shape. So you should test whether your array contains exactly one brep and work with that one, or if the array contains zero breps or more than one and take appropriate action.

Either  do like this:

sc.doc.Objects.AddBrep(a[0])

or loop:

for i in a:

.....sc.doc.Objects.AddBrep(i)

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service