Update ArchComponent and importIFC to use values from the new ifc_products dictionary
This commit is contained in:
@@ -61,12 +61,12 @@ with open(os.path.join(FreeCAD.getResourceDir(),"Mod","Arch","Presets","ifc_prod
|
||||
ifcProducts = json.load(f)
|
||||
|
||||
# Possible roles for FreeCAD BIM objects
|
||||
IfcRoles = ['Undefined']+[''.join(map(lambda x: x if x.islower() else " "+x, t[3:]))[1:] for t in [product["name"] for product in ifcProducts]]
|
||||
IfcRoles = ['Undefined']+[''.join(map(lambda x: x if x.islower() else " "+x, t[3:]))[1:] for t in ifcProducts.keys()]
|
||||
|
||||
def getIfcProduct(IfcRole):
|
||||
for ifcProduct in ifcProducts:
|
||||
if ifcProduct["name"] == 'Ifc' + IfcRole.replace(' ', ''):
|
||||
return ifcProduct
|
||||
name = "Ifc" + IfcRole.replace(" ", "")
|
||||
if name in ifcProducts:
|
||||
return ifcProducts[name]
|
||||
|
||||
def getIfcProductAttribute(ifcProduct, name):
|
||||
for attribute in ifcProduct["attributes"]:
|
||||
|
||||
@@ -1724,8 +1724,8 @@ def export(exportList,filename):
|
||||
count += 1
|
||||
continue
|
||||
|
||||
from ArchComponent import IFCTYPES
|
||||
if ifctype not in IFCTYPES:
|
||||
from ArchComponent import ifcProducts
|
||||
if ifctype not in ifcProducts.keys():
|
||||
ifctype = "IfcBuildingElementProxy"
|
||||
|
||||
# getting the "Force BREP" flag
|
||||
|
||||
Reference in New Issue
Block a user