mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 02:07:36 +00:00
small fix and mod in ifc2ca
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import json
|
import json
|
||||||
import ifcopenshell
|
import ifcopenshell
|
||||||
import os
|
import os
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
|
||||||
class CA2IFC:
|
class CA2IFC:
|
||||||
@@ -317,7 +318,8 @@ class CA2IFC:
|
|||||||
)
|
)
|
||||||
p_o = self.f.createIfcPersonAndOrganization(person, organization)
|
p_o = self.f.createIfcPersonAndOrganization(person, organization)
|
||||||
application = self.f.createIfcApplication(organization, "v0.0.x", "IFC2CA", "IFC2CA")
|
application = self.f.createIfcApplication(organization, "v0.0.x", "IFC2CA", "IFC2CA")
|
||||||
ownerHistory = self.f.createIfcOwnerHistory(p_o, application, "READWRITE", None, None, p_o, application)
|
timestamp = int(datetime.now().timestamp())
|
||||||
|
ownerHistory = self.f.createIfcOwnerHistory(p_o, application, "READWRITE", None, None, None, None, timestamp)
|
||||||
|
|
||||||
return ownerHistory
|
return ownerHistory
|
||||||
|
|
||||||
@@ -497,8 +499,8 @@ class CA2IFC:
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
inputFilename = "structure_01.json"
|
inputFilename = "grid_of_beams.json"
|
||||||
outputFilename = "structure_01.ifc"
|
outputFilename = "grid_of_beams.ifc"
|
||||||
|
|
||||||
ca2ifc = CA2IFC(inputFilename, outputFilename)
|
ca2ifc = CA2IFC(inputFilename, outputFilename)
|
||||||
ca2ifc.convert()
|
ca2ifc.convert()
|
||||||
|
|||||||
@@ -257,11 +257,6 @@ class MODEL:
|
|||||||
init_time += elapsed_time
|
init_time += elapsed_time
|
||||||
print("Building Geometry Defined in %g sec" % (elapsed_time))
|
print("Building Geometry Defined in %g sec" % (elapsed_time))
|
||||||
|
|
||||||
if len([e for e in elements if e["geometryType"] == "line"]) > 0:
|
|
||||||
buildingShapeType = "EDGE"
|
|
||||||
if len([e for e in elements if e["geometryType"] == "surface"]) > 0:
|
|
||||||
buildingShapeType = "FACE"
|
|
||||||
|
|
||||||
# Define and add groups for all curve and surface members
|
# Define and add groups for all curve and surface members
|
||||||
if len([e for e in elements if e["geometryType"] == "line"]) > 0:
|
if len([e for e in elements if e["geometryType"] == "line"]) > 0:
|
||||||
# Make compound of requested group
|
# Make compound of requested group
|
||||||
|
|||||||
@@ -208,11 +208,6 @@ class MODEL:
|
|||||||
init_time += elapsed_time
|
init_time += elapsed_time
|
||||||
print("Building Geometry Defined in %g sec" % (elapsed_time))
|
print("Building Geometry Defined in %g sec" % (elapsed_time))
|
||||||
|
|
||||||
if len([e for e in elements if e["geometryType"] == "line"]) > 0:
|
|
||||||
buildingShapeType = "EDGE"
|
|
||||||
if len([e for e in elements if e["geometryType"] == "surface"]) > 0:
|
|
||||||
buildingShapeType = "FACE"
|
|
||||||
|
|
||||||
# Define and add groups for all curve, surface and rigid members
|
# Define and add groups for all curve, surface and rigid members
|
||||||
if len([e for e in elements if e["geometryType"] == "line"]) > 0:
|
if len([e for e in elements if e["geometryType"] == "line"]) > 0:
|
||||||
# Make compound of requested group
|
# Make compound of requested group
|
||||||
|
|||||||
Reference in New Issue
Block a user