Arch: IFC export, small code formating

This commit is contained in:
Bernd Hahnebach
2019-09-02 07:36:57 +02:00
parent 8e91b3ab2c
commit 67efd10dea
2 changed files with 20 additions and 9 deletions

View File

@@ -355,7 +355,14 @@ def export(exportList,filename,colors=None,preferences=None):
# getting the representation
representation,placement,shapetype = getRepresentation(ifcfile,context,obj,forcebrep=(brepflag or preferences['FORCE_BREP']),colors=colors,preferences=preferences)
representation,placement,shapetype = getRepresentation(
ifcfile,
context,
obj,
forcebrep=(brepflag or preferences['FORCE_BREP']),
colors=colors,
preferences=preferences
)
if getstd:
if isStandardCase(obj,ifctype):
ifctype += "StandardCase"
@@ -501,7 +508,7 @@ def export(exportList,filename,colors=None,preferences=None):
sheet = obj.IfcProperties
propertiesDic = {}
categories = []
n=2
n = 2
cell = True
while cell is True:
if hasattr(sheet,'A'+str(n)):

View File

@@ -27,7 +27,7 @@ import math
import FreeCAD
import Draft
# import Draft
def getObjectsOfIfcType(objects, ifcType):
@@ -41,14 +41,18 @@ def getObjectsOfIfcType(objects, ifcType):
class SIUnitCreator:
def __init__(self, file, text, type):
self.prefixes = ["EXA", "PETA", "TERA", "GIGA", "MEGA", "KILO", "HECTO",
self.prefixes = [
"EXA", "PETA", "TERA", "GIGA", "MEGA", "KILO", "HECTO",
"DECA", "DECI", "CENTI", "MILLI", "MICRO", "NANO", "PICO", "FEMTO",
"ATTO"]
self.unitNames = ["AMPERE", "BECQUEREL", "CANDELA", "COULOMB",
"ATTO"
]
self.unitNames = [
"AMPERE", "BECQUEREL", "CANDELA", "COULOMB",
"CUBIC_METRE", "DEGREE CELSIUS", "FARAD", "GRAM", "GRAY", "HENRY",
"HERTZ", "JOULE", "KELVIN", "LUMEN", "LUX", "MOLE", "NEWTON", "OHM",
"PASCAL", "RADIAN", "SECOND", "SIEMENS", "SIEVERT", "SQUARE METRE",
"METRE", "STERADIAN", "TESLA", "VOLT", "WATT", "WEBER"]
"METRE", "STERADIAN", "TESLA", "VOLT", "WATT", "WEBER"
]
self.text = text
self.SIUnit = file.createIfcSIUnit(None, type, self.getSIPrefix(), self.getSIUnitName())
@@ -101,7 +105,7 @@ class ContextCreator:
self.project_data["map_projection"],
self.project_data["map_zone"],
SIUnit.SIUnit
)
)
except:
return None
@@ -115,7 +119,7 @@ class ContextCreator:
self.calculateXAxisAbscissa(),
self.calculateXAxisOrdinate(),
float(self.project_data["scale"])
)
)
except:
return None