-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProgram.cs
More file actions
85 lines (64 loc) · 2.23 KB
/
Copy pathProgram.cs
File metadata and controls
85 lines (64 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
using GeometryGym.Ifc;
var db = new DatabaseIfc(ReleaseVersion.IFC4X3);
var facility = new IfcFacility(db, "My Facility")
{
Description = "Just another facility",
};
var bridge = new IfcBridge(facility, "My Bridge", null, null)
{
Description = "Just another bridge"
};
var project = new IfcProject(facility, "My Project", IfcUnitAssignment.Length.Metre);
{
};
var foundations = new IfcBridgePart(
bridge, null, null
);
var name = "Pile Cap";
var length = 1.2;
var width = 2.4;
var depth = 4.8;
IfcMaterial material = new IfcMaterial(db, "Concrete")
{
};
IfcFootingType footingType = new IfcFootingType(db, name, IfcFootingTypeEnum.PAD_FOOTING)
{
MaterialSelect = material,
};
IfcRectangleProfileDef rect = new IfcRectangleProfileDef(db, "rect", length, width);
// IfcProductDefinitionShape rectProduct = new IfcProductDefinitionShape(new IfcShapeRepresentation(rect, ShapeRepresentationType.Curve2D));
IfcExtrudedAreaSolid extrusion = new IfcExtrudedAreaSolid(rect, new IfcAxis2Placement3D(new IfcCartesianPoint(db, 0, 0, 0)), new IfcDirection(db, 0, 0, 1), depth);
IfcProductDefinitionShape productRep = new IfcProductDefinitionShape(new IfcShapeRepresentation(extrusion));
IfcShapeRepresentation shapeRep = new(extrusion);
footingType.RepresentationMaps.Add(
new IfcRepresentationMap(
db.Factory.XYPlanePlacement,
shapeRep
)
);
IfcFooting footing = new(
foundations,
null,
productRep
)
{
PredefinedType = IfcFootingTypeEnum.PAD_FOOTING,
ObjectType = name
};
IfcLine line = new IfcLine(
new IfcCartesianPoint(db, 0,0,0),
new IfcVector(new IfcDirection(db, 1, 0), 10.0)
);
IfcSectionedSolidHorizontal sec = new IfcSectionedSolidHorizontal(
line,
new List<IfcProfileDef> { rect, rect, rect},
new List<IfcAxis2PlacementLinear> {
new IfcAxis2PlacementLinear(new IfcPointByDistanceExpression(0.0, line)),
new IfcAxis2PlacementLinear(new IfcPointByDistanceExpression(5.0, line)),
new IfcAxis2PlacementLinear(new IfcPointByDistanceExpression(10.0, line)) },
true
);
IfcBeam beam = new(foundations, null, new IfcProductDefinitionShape(new IfcShapeRepresentation(sec))){
PredefinedType = IfcBeamTypeEnum.BEAM
};
db.WriteFile("IFC4X3RC4_testBridge.ifc");