我想创建一个表示梁的IFC文件。我得到的输入是两个点和一个横截面定义。其目的是查看梁的形状。谁能给我指个正确的方向。XBim有没有什么东西可以让人做到这一点?
我尝试读取从Tekla导出的IFC文件,该文件只有一个光束。我试着通读IFC模式定义规范。(不是很成功地找到了一个)
未编写任何代码
我期望的是输入一个配置文件。(我不知道如何输入截面轮廓),输入起点和终点以创建表示梁的IFC文件。然后,我应该能够在IFC查看器中打开文件并查看梁
发布于 2019-11-08 02:32:25
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;
} 为了创建一个笛卡尔二维点,我使用这个方法:
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;
}可以通过以下方式创建proifle的拉伸实体形式:
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;
}发布于 2021-09-10 11:27:15
谢谢。我就试试这个吧。
https://stackoverflow.com/questions/57861331
复制相似问题