Add contexts file for IFC2X3

This commit is contained in:
Dion Moult
2019-08-19 21:02:53 +10:00
committed by Bernd Hahnebach
parent 89961a33d4
commit bdfdf77ffc
3 changed files with 67 additions and 11 deletions

View File

@@ -3,20 +3,9 @@ import FreeCAD, os, json
ifcVersions = ["IFC4", "IFC2X3"]
IfcVersion = ifcVersions[FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetInt("IfcVersion",0)]
# BEGIN FIXME
# the file ifc_contexts_IFC2x3.json is missing at all in sources
# All Arch module is broken if pref is set to IFC2x3
# we will use the IFC4 one instead, to get back the Arch module
# Still lots of stuff does not work, but at least the Arch loads
'''
with open(os.path.join(FreeCAD.getResourceDir(), "Mod", "Arch", "Presets",
"ifc_contexts_" + IfcVersion + ".json")) as f:
IfcContexts = json.load(f)
'''
with open(os.path.join(FreeCAD.getResourceDir(), "Mod", "Arch", "Presets",
"ifc_contexts_" + "IFC4" + ".json")) as f:
IfcContexts = json.load(f)
# END FIXME
with open(os.path.join(FreeCAD.getResourceDir(), "Mod", "Arch", "Presets",
"ifc_products_" + IfcVersion + ".json")) as f:

View File

@@ -66,6 +66,7 @@ SET(Arch_presets
Presets/ifc_products_IFC4.json
Presets/ifc_types_IFC2X3.json
Presets/ifc_types_IFC4.json
Presets/ifc_contexts_IFC2X3.json
Presets/ifc_contexts_IFC4.json
)

View File

@@ -0,0 +1,66 @@
{
"IfcProject": {
"is_abstract": false,
"parent": "IfcObject",
"attributes": [
{
"name": "GlobalId",
"type": "IfcGloballyUniqueId",
"is_enum": false,
"enum_values": []
},
{
"name": "Name",
"type": "IfcLabel",
"is_enum": false,
"enum_values": []
},
{
"name": "Description",
"type": "IfcText",
"is_enum": false,
"enum_values": []
},
{
"name": "ObjectType",
"type": "IfcLabel",
"is_enum": false,
"enum_values": []
},
{
"name": "LongName",
"type": "IfcLabel",
"is_enum": false,
"enum_values": []
},
{
"name": "Phase",
"type": "IfcLabel",
"is_enum": false,
"enum_values": []
}
],
"complex_attributes": [
{
"name": "OwnerHistory",
"type": "IfcOwnerHistory"
},
{
"name": "IsDecomposedBy",
"type": "IfcRelAggregates"
},
{
"name": "RepresentationContexts",
"type": "IfcRepresentationContext"
},
{
"name": "UnitsInContext",
"type": "IfcUnitAssignment"
},
{
"name": "IsDefinedBy",
"type": "IfcRelDefinesByProperties"
}
]
}
}