From ecaf9000f6459b4ec9ddd76db09052f18c7d5cb1 Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Mon, 2 Sep 2019 07:32:05 +0200 Subject: [PATCH] Arch IFC import and export, new lines and comments --- src/Mod/Arch/exportIFC.py | 6 ++---- src/Mod/Arch/exportIFCHelper.py | 4 ++-- src/Mod/Arch/importIFC.py | 3 +-- src/Mod/Arch/importIFCHelper.py | 3 --- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/Mod/Arch/exportIFC.py b/src/Mod/Arch/exportIFC.py index eaed5a81ac..413a70f768 100644 --- a/src/Mod/Arch/exportIFC.py +++ b/src/Mod/Arch/exportIFC.py @@ -107,9 +107,7 @@ END-ISO-10303-21; # ************************************************************************************************ -# ********** duplicate methods **************** -# TODO get rid of this duplicate - +# ********** get the prefs, available in import and export **************** def getPreferences(): """retrieves IFC preferences""" @@ -135,9 +133,9 @@ def getPreferences(): return preferences + # ************************************************************************************************ # ********** export IFC **************** - def export(exportList,filename,colors=None,preferences=None): """export(exportList,filename,colors=None,preferences=None) -- exports FreeCAD contents to an IFC file. diff --git a/src/Mod/Arch/exportIFCHelper.py b/src/Mod/Arch/exportIFCHelper.py index b5c38e5193..2cb35eead0 100644 --- a/src/Mod/Arch/exportIFCHelper.py +++ b/src/Mod/Arch/exportIFCHelper.py @@ -38,6 +38,7 @@ def getObjectsOfIfcType(objects, ifcType): results.append(object) return results + class SIUnitCreator: def __init__(self, file, text, type): self.prefixes = ["EXA", "PETA", "TERA", "GIGA", "MEGA", "KILO", "HECTO", @@ -63,6 +64,7 @@ class SIUnitCreator: return unitName return None + class ContextCreator: def __init__(self, file, objects): self.file = file @@ -171,8 +173,6 @@ class ContextCreator: return json.loads(self.project_object.IfcData['complex_attributes'])["RepresentationContexts"] - - class recycler: "the compression engine - a mechanism to reuse ifc entities if needed" diff --git a/src/Mod/Arch/importIFC.py b/src/Mod/Arch/importIFC.py index c416a5c648..74700bef44 100644 --- a/src/Mod/Arch/importIFC.py +++ b/src/Mod/Arch/importIFC.py @@ -138,8 +138,7 @@ structuralifcobjects = ( # ************************************************************************************************ -# ********** duplicate methods, they are in importIFC and exportIFC **************** -# TODO get rid of this duplicate +# ********** get the prefs, available in import and export **************** def getPreferences(): """retrieves IFC preferences""" diff --git a/src/Mod/Arch/importIFCHelper.py b/src/Mod/Arch/importIFCHelper.py index d29dec1f16..dc05ea006e 100644 --- a/src/Mod/Arch/importIFCHelper.py +++ b/src/Mod/Arch/importIFCHelper.py @@ -32,7 +32,6 @@ import ArchIFC # ************************************************************************************************ # ********** some helper, used in import and export, or should stay together - def decode(filename,utf=False): "turns unicodes into strings" @@ -243,8 +242,6 @@ def buildRelMattable(ifcfile): # color relation tables # products can have a color and materials can have a color and products can have a material # colors for material assigned to a product and product color can be different - - def buildRelColors(ifcfile, prodrepr): """build the colors relation table and"""