Open jeromerolland opened 5 years ago
Bonjour Jerome,
If you use the Work In Progress branch of the toolkit, then hoepfully below gives some insights into how to traverse the geometry.
Cheers,
Jon
DatabaseIfc db = new DatabaseIfc("Filepath");
List<IfcElement> elements = db.Project.Extract<IfcElement>();
foreach(IfcElement element in elements)
{
foreach (IfcFacetedBrep brep in element.Representation.Representations.SelectMany(x => x.Items).OfType<IfcFacetedBrep>())
{
foreach (IfcFace face in brep.Outer.CfsFaces)
{
if(face.Bounds.Count == 1)
{
if(face.Bounds[0].Bound is IfcPolyloop polyLoop)
{
foreach(IfcCartesianPoint p in polyLoop.Polygon)
{
}
}
}
}
}
}
Hi Jon,
Thank you very much for your code sample.
Best regards,
Jérôme
Jon
Has this code example changed? I'm trying to use it at the moment and it's not liking "Bounds[0].Bound"
Chris
Yes, I've been improving the plugin to use a "SET" (unordered collection) rather than a list when the IFC specification nominates it. You can use linq using "Bounds.First().Bound" instead of a zero index. Sorry for the breaking change, but it does improve the toolkit in other aspects.
Hi, do you have an example for parsing geometry in ifc file ?
best regards, Jérôme