1

我想创建一个代表梁的 IFC 文件。我的输入是 2 个点和一个横截面定义。目的是查看光束的形状。有人可以指出我正确的方向。XBim 有什么东西可以做到这一点吗?

我试图通读从 Tekla 导出的只有一个梁的 IFC 文件。我试图通读 IFC 模式定义规范。(找到一个不是很成功)

没有写代码

我期待的是输入个人资料。(我不知道如何输入轮廓),输入起点和终点以创建代表梁的IFC文件。然后我应该能够在 IFC 查看器中打开文件并查看梁

4

2 回答 2

0

谢谢你,我会试试这个。

于 2021-09-10T11:27:14.990 回答
0

XBim 将所有 IFC 实体提供为 C# 类(早期绑定)。

例如,您可以通过以下方式创建交叉配置文件:

public IfcProfileDef getBasicProfileDescirption() {
    IfcPolyline polyline = new IfcPolyline(id++);
    model_.insertEntity(polyline);

    double Left = -OverallWidth_ / 2.0;
    double Right = OverallWidth_ / 2.0;
    double Top = OverallDepth_ / 2.0;
    double Bottom = -OverallDepth_ / 2.0;

    polyline.Points.add(createPoint(Left,Top) ); // coordinate (A)
    polyline.Points.add(createPoint(Right,Top) ); // coordinate (B)
    polyline.Points.add(createPoint(Right,Top-FlangeThickness_)); // coordinate (C)
    polyline.Points.add(createPoint(WebThickness_*0.5,Top-FlangeThickness_) ); // coordinate (D)
    polyline.Points.add(createPoint(WebThickness_*0.5,Bottom+FlangeThickness_) ); // coordinate (E)
    polyline.Points.add(createPoint(Right,Bottom+FlangeThickness_) ); // coordinate (F)
    polyline.Points.add(createPoint(Right,Bottom) ); // coordinate (G)
    polyline.Points.add(createPoint(Left,Bottom) ); // coordinate (H)
    polyline.Points.add(createPoint(Left,Bottom+FlangeThickness_) ); // coordinate (I)
    polyline.Points.add(createPoint(-WebThickness_*0.5,Bottom+FlangeThickness_) ); // coordinate (J)
    polyline.Points.add(createPoint(-WebThickness_*0.5,Top-FlangeThickness_) ); // coordinate (K)
    polyline.Points.add(createPoint(Left,Top-FlangeThickness_) ); // coordinate (L)
    // close profile
    polyline.Points.add(createPoint(Left,Top)); // coordinate (A)

    IfcArbitraryClosedProfileDef profile = new IfcArbitraryClosedProfileDef(id++);
    model_.insertEntity(profile);

    //profile.ProfileType = new IfcProfileTypeEnum(IfcProfileTypeEnum.AREA);
    profile.OuterCurve = polyline;

    return profile;
} 

要创建笛卡尔 2d 点,我使用以下方法:

private IfcCartesianPoint createPoint(double x, double y) {
    IfcCartesianPoint point = new IfcCartesianPoint(id++);

    point.Coordinates.add(new IfcLengthMeasure(x));
    point.Coordinates.add(new IfcLengthMeasure(y));

    model_.insertEntity(point);

    return point;
}

可以通过以下方式创建挤压实体形式的轮廓:

private IfcExtrudedAreaSolid getBasicProfileDescirption() {
    IfcExtrudedAreaSolid baseMesh = new IfcExtrudedAreaSolid();
    baseMesh.SweptArea = getBasicProfileDescirption();
    baseMesh.ExtrudedDirection = createDirecton(0, 0, 1);
    baseMesh.Depth = new IfcPositiveLengthMeasure(scale_ * height_);
    return baseMesh;
}

IFC 定义了许多可以使用的交叉部分(配置文件):

在此处输入图像描述

顺便说一句,该getDirection方法如下所示:

private IfcDirection createDirecton(double x, double y, double z) {
    IfcDirection dir = new IfcDirection();
    dir.DirectionRatios.add(new IfcReal(x));
    dir.DirectionRatios.add(new IfcReal(y));
    dir.DirectionRatios.add(new IfcReal(z));
    return dir;
}
于 2019-11-07T18:32:24.730 回答