Eine Datei, die gemäß den Spezifikationen der Industry Foundation-Klassen erstellt wurde. Beinhaltet Elemente, die im Bauwesen in der Bauindustrie verwendet werden (Wände, Fenster, Türen, Baumaschinen usw.). Wenn Sie über eine IFC-Datei verfügen, können Sie das Gebäude mithilfe einer Visualisierungs-App in 3D reproduzieren.
·Umgebung -Lesen Sie eine vorhandene IFC-Datei ・ Fügen Sie eine Musterwand hinzu -Ausgabe als neue IFC-Datei
conda install -c conda-forge -c oce -c dlr-sc -c ifcopenshell ifcopenshell
conda install -c conda-forge -c dlr-sc -c pythonocc -c oce pythonocc-core
import ifcopenshell
from ifcopenshell import geom
settings = ifcopenshell.geom.settings()
settings.set(settings.USE_PYTHON_OPENCASCADE, True)
#Lesen Sie eine vorhandene IFC-Datei
ifc_file = ifcopenshell.open("sample.ifc")
#Laden Sie die neu erstellte Wandvorlage
sample_wall = ifc_file.createIfcWall()
#Koordinaten einstellen
context = ifc_file.by_type("IfcGeometricRepresentationContext")[0]
point1 = ifc_file.createIfcCartesianPoint((0.0, 0.0, 0.0))
point2 = ifc_file.createIfcCartesianPoint((5.0, 0.0, 0.0))
ifcpts = []
ifcpts.append(point1)
ifcpts.append(point2)
polyline = ifc_file.createIfcPolyLine(ifcpts)
#Stellen Sie die Form ein
axis_representation = ifc_file.createIfcShapeRepresentation(context, "Axis", "Curve2D", [polyline])
product_shape = ifc_file.createIfcProductDefinitionShape(None, None, [axis_representation])
#Fügen Sie eine neue Wand hinzu
sample_wall.Representation = product_shape
ifc_file.add(sample_wall.Representation)
#Als separate Datei exportieren
ifc_file.write("sample_new.ifc")
・ Erstellen einer einfachen Wand mit Informationen zu Eigenschaften und Mengen ・ Versuchen Sie, die Wand selbst zu erstellen
Recommended Posts