BReps in DataTrees

Hi All

 

I'm scripting a C# module that generates a double layer gridshell over a surface, but I've run into a problem with outputting the generated BReps in DataTrees.

 

I'm generating the geometry by lofting through a series of rectangles aligned to a surface. This generates a BRep[] for each loft.

 

If I output a single instance of the resulting BRep[], then Grasshopper recognises this as an untrimmed surface and works OK. However, if I add a series of BRep[]'s to a DataTree, then Grasshopper doesn't seem to recognise the output. Grasshopper displays the contents of the tree as 'Rhino.Geometry.BRep[]', but recognise these as valid geometry and gives the error message 'Data conversion failed from Goo to Brep' - see screenshot: Gridshell%20module.jpg

 

I don't understand by adding these objects to a DataTree (or Rhinolist) causes Grasshopper to treate them differently...can anyone shed any light on this please?

 

Thanks

Alex

  • up

    Jens Pedersen

    Hi Alex

     

    I normally write in vb.net, but I am planning on jumping into c# very soon. But notmally when I do lofts they create an array, which means inorder to add the created brep to a list/datatree I have to say; mydatatree.add(BRep(0),path)...

     

    Becasue what it seems to be happening is that you are adding the entire array as an object, which isnt a brep but a breparray.

     

    As I said I norammly write in vb.net, so I dont know if this method transcends syntax. Let me know how this turns out, becasue I am sure that it will save me a lot of time when I have to do the step from vb.net to c#.

     

    Good luck

    3