From ca59b3220bdf29a0057d4ae9d71709a56137f948 Mon Sep 17 00:00:00 2001 From: Jesusbill Date: Fri, 19 Mar 2021 23:39:25 +0100 Subject: [PATCH] small fix and mod in ifc2ca --- src/ifc2ca/ca2ifc.py | 8 +++++--- src/ifc2ca/scriptSalome.py | 5 ----- src/ifc2ca/scriptSalomeBonded.py | 5 ----- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/ifc2ca/ca2ifc.py b/src/ifc2ca/ca2ifc.py index 566f446148..1a1cd95361 100644 --- a/src/ifc2ca/ca2ifc.py +++ b/src/ifc2ca/ca2ifc.py @@ -1,6 +1,7 @@ import json import ifcopenshell import os +from datetime import datetime class CA2IFC: @@ -317,7 +318,8 @@ class CA2IFC: ) p_o = self.f.createIfcPersonAndOrganization(person, organization) 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 @@ -497,8 +499,8 @@ class CA2IFC: if __name__ == "__main__": - inputFilename = "structure_01.json" - outputFilename = "structure_01.ifc" + inputFilename = "grid_of_beams.json" + outputFilename = "grid_of_beams.ifc" ca2ifc = CA2IFC(inputFilename, outputFilename) ca2ifc.convert() diff --git a/src/ifc2ca/scriptSalome.py b/src/ifc2ca/scriptSalome.py index 954b30614c..8e761078fe 100644 --- a/src/ifc2ca/scriptSalome.py +++ b/src/ifc2ca/scriptSalome.py @@ -257,11 +257,6 @@ class MODEL: init_time += 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 if len([e for e in elements if e["geometryType"] == "line"]) > 0: # Make compound of requested group diff --git a/src/ifc2ca/scriptSalomeBonded.py b/src/ifc2ca/scriptSalomeBonded.py index d6eec9b824..0d17b1047c 100755 --- a/src/ifc2ca/scriptSalomeBonded.py +++ b/src/ifc2ca/scriptSalomeBonded.py @@ -208,11 +208,6 @@ class MODEL: init_time += 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 if len([e for e in elements if e["geometryType"] == "line"]) > 0: # Make compound of requested group