Navigation Menu

Skip to content

Commit

Permalink
Add contexts file for IFC2X3
Browse files Browse the repository at this point in the history
  • Loading branch information
Moult authored and berndhahnebach committed Aug 20, 2019
1 parent 89961a3 commit bdfdf77
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/Mod/Arch/ArchIFCSchema.py
Expand Up @@ -3,20 +3,9 @@
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:
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Arch/CMakeLists.txt
Expand Up @@ -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
)

Expand Down
66 changes: 66 additions & 0 deletions src/Mod/Arch/Presets/ifc_contexts_IFC2X3.json
@@ -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"
}
]
}
}

0 comments on commit bdfdf77

Please sign in to comment.