Arch: IFC export, small code formating
This commit is contained in:
@@ -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)):
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user