Enquiry about IfcSlab creation‏‏ with Xbim library

I have a problem with creating ifcSlab particularly with this attribute coordList,
I did not know how to pass the slab vertices “slab profile” to this attribute.

model.Instances.New (def =>
def.OuterCurve = model.Instances.New (pc =>
pc.Points = model.Instances.New (cp2d =>
cp2d.CoordList.Add (

                                                                // What to add here?

                                                                                          )   )));

this image is a screenshot from an IFC file exported from Revit as IFC 4 includes a simple floor.

I haven’t used XBim before, but I assume the CoordList requires a list of lists of IfcLengthMeasure, depending on the dimensionality of the curve, e.g:

[ [0,0], [1,1], [1,0], ...]

I tried this piece of code and it goes well, Thanks Dion Moult.
var outerCurvepoints = model.Instances.New();
outerCurvepoints.CoordList.GetAt(0).AddRange(new IfcLengthMeasure { -14500.0, 13250.0 });
outerCurvepoints.CoordList.GetAt(1).AddRange(new IfcLengthMeasure { -14500.0, -14750.0 });
outerCurvepoints.CoordList.GetAt(2).AddRange(new IfcLengthMeasure { -1500.0, -14750.0 });
outerCurvepoints.CoordList.GetAt(3).AddRange(new IfcLengthMeasure { -1500.0, -18750.0 });
outerCurvepoints.CoordList.GetAt(4).AddRange(new IfcLengthMeasure { 19500.0, -18750.0 });
outerCurvepoints.CoordList.GetAt(5).AddRange(new IfcLengthMeasure { 19500.0, 20250.0 });
outerCurvepoints.CoordList.GetAt(6).AddRange(new IfcLengthMeasure { -3500.0, 20250.0 });
outerCurvepoints.CoordList.GetAt(7).AddRange(new IfcLengthMeasure { -3500.0, 13250.0 });
outerCurvepoints.CoordList.GetAt(8).AddRange(new IfcLengthMeasure { -14500.0, 13250.0 });
var outerCurve = model.Instances.New();
outerCurve.SelfIntersect = false;
outerCurve.Points = outerCurvepoints;
var representationMap = model.Instances.New();
var mappedRepresentation = representationMap.MappedRepresentation = model.Instances.New();
mappedRepresentation.Items.Add(model.Instances.New(eas =>
{
eas.Depth = Thickness;
eas.SweptArea = model.Instances.New(apdwv =>
{
apdwv.ProfileType = IfcProfileTypeEnum.AREA;
apdwv.ProfileName = ProfileName;
apdwv.OuterCurve = outerCurve; <<===========
});
});

1 Like