Model Object To Brep

Hi everybody!
I’m looking to convert Model Object Tekla components to brep. I have obtained Model Object components from view. But don’t know how to convert them to Brep. If I try to use Convert to Brep, the resulting Breps are discrete, they cannot be flattened together. Anyone have any ideas how to convert to brep and flatten them together? Thanks a lot
Here is an illustration


Model Object to Brep.gh (2.1 KB)

Assigned to Tekla category

Hello,

I think you just need to Trim Tree one level down.

Since a Model object conversion to Brep can lead to several separate pieces, GH grafts the output.

2 Likes

do you have a way to convert from Model Object to Brep using C# script?

It’s possible (the Convert to Brep component does it), but quite long to implement.
Starting from the GetSolid() method, you can extract the faces enumerator, then for each face the loops enumerator, then for each loop the vertices enumerator and rebuild a Rhino Polyline from there.
Note that not all ModelObjects accept the GetSolid, so you have to test your object type (Part, BoltGroup, BaseWeld…)

https://developer.tekla.com/tekla-structures/api/22/13734

https://developer.tekla.com/tekla-structures/api/22/15055
https://developer.tekla.com/tekla-structures/api/22/15826
https://developer.tekla.com/tekla-structures/api/22/15842

Then build a planar surface from the polylines with Brep.CreatePlanarBreps Method

Then join the faces into one or several Brep(s).

:cold_sweat:

1 Like

thanks you so much!