Remove dependency on ifcopenshell at runtime and introduce new IfcVersion config

This commit is contained in:
Dion Moult
2019-01-29 21:14:35 +11:00
parent 471eb4cad3
commit c9d08b7311
4 changed files with 100 additions and 19 deletions

View File

@@ -25,9 +25,8 @@ __title__="FreeCAD Arch Component"
__author__ = "Yorik van Havre"
__url__ = "http://www.freecadweb.org"
import FreeCAD,Draft,ArchCommands,math,sys,json,os,ifcopenshell,ArchIFC
import FreeCAD,Draft,ArchCommands,math,sys,json,os,ArchIFC,ArchIFCSchema
from FreeCAD import Vector
from ArchIFC import ifcProducts, ifcTypes
if FreeCAD.GuiUp:
import FreeCADGui
from PySide import QtGui,QtCore
@@ -48,8 +47,7 @@ else:
# This module provides the base Arch component class, that
# is shared by all of the Arch BIM objects
# Possible roles for FreeCAD BIM objects
IfcRoles = ['Undefined']+[''.join(map(lambda x: x if x.islower() else " "+x, t[3:]))[1:] for t in ifcProducts.keys()]
IfcRoles = ['Undefined']+[''.join(map(lambda x: x if x.islower() else " "+x, t[3:]))[1:] for t in ArchIFCSchema.IfcProducts.keys()]
def convertOldComponents(objs=[]):
@@ -1183,10 +1181,10 @@ class ComponentTaskPanel:
return
if not isinstance(self.obj.IfcProperties,dict):
return
import Arch_rc,csv,os
import Arch_rc, csv, os, ArchIFCSchema
# get presets
self.ptypes = ifcTypes.keys()
self.ptypes = ArchIFCSchema.IfcTypes.keys()
self.plabels = [''.join(map(lambda x: x if x.islower() else " "+x, t[3:]))[1:] for t in self.ptypes]
self.psetdefs = {}
psetspath = os.path.join(FreeCAD.getResourceDir(),"Mod","Arch","Presets","pset_definitions.csv")