FreeCAD

Форк
0
/
ArchIFCSchema.py 
48 строк · 2.4 Кб
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                                 *
5
#*                                                                         *
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.                                 *
11
#*                                                                         *
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.                  *
16
#*                                                                         *
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  *
20
#*   USA                                                                   *
21
#*                                                                         *
22
#***************************************************************************
23

24
"""Provides the IFC schema data as dicts, by loading the JSON schema files.
25

26
Provides the data as IfcContexts, IfcProducts and IfcTypes.
27
"""
28

29
import os
30
import json
31

32
import FreeCAD
33
from draftutils import params
34

35
ifcVersions = ["IFC4", "IFC2X3"]
36
IfcVersion = ifcVersions[params.get_param_arch("IfcVersion")]
37

38
with open(os.path.join(FreeCAD.getResourceDir(), "Mod", "BIM", "Presets",
39
"ifc_contexts_" + IfcVersion + ".json")) as f:
40
    IfcContexts = json.load(f)
41

42
with open(os.path.join(FreeCAD.getResourceDir(), "Mod", "BIM", "Presets",
43
"ifc_products_" + IfcVersion + ".json")) as f:
44
    IfcProducts = json.load(f)
45

46
with open(os.path.join(FreeCAD.getResourceDir(), "Mod", "BIM", "Presets",
47
"ifc_types_" + IfcVersion + ".json")) as f:
48
    IfcTypes = json.load(f)
49

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.