From e633024aff434f8087d1a01af626b8b589a1ca79 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Tue, 18 Apr 2023 15:01:47 +0200 Subject: [PATCH] Arch: Allow the IFC export recycler to work with other templates The IFC export recycler always assumes to be used from the Arch builtin IFC exporter from exportIFC.py. This change allows it to be used with other templates/input files as well --- src/Mod/Arch/exportIFCHelper.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Mod/Arch/exportIFCHelper.py b/src/Mod/Arch/exportIFCHelper.py index fabf327516..37719a28ad 100644 --- a/src/Mod/Arch/exportIFCHelper.py +++ b/src/Mod/Arch/exportIFCHelper.py @@ -203,17 +203,21 @@ class recycler: # but it checks if a similar entity already exists before creating a new one # to compress a new type, just add the necessary method here - def __init__(self,ifcfile): + def __init__(self,ifcfile,template=True): self.ifcfile = ifcfile self.compress = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("ifcCompress",True) self.mergeProfiles = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("ifcMergeProfiles",False) - self.cartesianpoints = {(0,0,0):self.ifcfile[8]} # from template - self.directions = {(1,0,0):self.ifcfile[6],(0,0,1):self.ifcfile[7],(0,1,0):self.ifcfile[10]} # from template + self.cartesianpoints = {} + self.directions = {} + self.axis2placement3ds = {} + if template: # we are using the default template from exportIFC.py + self.cartesianpoints = {(0,0,0):self.ifcfile[8]} # from template + self.directions = {(1,0,0):self.ifcfile[6],(0,0,1):self.ifcfile[7],(0,1,0):self.ifcfile[10]} # from template + self.axis2placement3ds = {'(0.0, 0.0, 0.0)(0.0, 0.0, 1.0)(1.0, 0.0, 0.0)':self.ifcfile[9]} # from template self.polylines = {} self.polyloops = {} self.propertysinglevalues = {} - self.axis2placement3ds = {'(0.0, 0.0, 0.0)(0.0, 0.0, 1.0)(1.0, 0.0, 0.0)':self.ifcfile[9]} # from template self.axis2placement2ds = {} self.localplacements = {} self.rgbs = {}