1
#***************************************************************************
2
#* Copyright (c) 2019 Dion Moult <dion@thinkmoult.com> *
3
#* Copyright (c) 2019 Yorik van Havre <yorik@uncreated.net> *
4
#* Copyright (c) 2019 FreeCAD Developers *
6
#* This program is free software; you can redistribute it and/or modify *
7
#* it under the terms of the GNU Lesser General Public License (LGPL) *
8
#* as published by the Free Software Foundation; either version 2 of *
9
#* the License, or (at your option) any later version. *
10
#* for detail see the LICENCE text file. *
12
#* This program is distributed in the hope that it will be useful, *
13
#* but WITHOUT ANY WARRANTY; without even the implied warranty of *
14
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15
#* GNU Library General Public License for more details. *
17
#* You should have received a copy of the GNU Library General Public *
18
#* License along with this program; if not, write to the Free Software *
19
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
22
#***************************************************************************
24
"""Provides the IFC schema data as dicts, by loading the JSON schema files.
26
Provides the data as IfcContexts, IfcProducts and IfcTypes.
33
from draftutils import params
35
ifcVersions = ["IFC4", "IFC2X3"]
36
IfcVersion = ifcVersions[params.get_param_arch("IfcVersion")]
38
with open(os.path.join(FreeCAD.getResourceDir(), "Mod", "BIM", "Presets",
39
"ifc_contexts_" + IfcVersion + ".json")) as f:
40
IfcContexts = json.load(f)
42
with open(os.path.join(FreeCAD.getResourceDir(), "Mod", "BIM", "Presets",
43
"ifc_products_" + IfcVersion + ".json")) as f:
44
IfcProducts = json.load(f)
46
with open(os.path.join(FreeCAD.getResourceDir(), "Mod", "BIM", "Presets",
47
"ifc_types_" + IfcVersion + ".json")) as f:
48
IfcTypes = json.load(f)