Merge branch 'v0.6.0' of https://github.com/IfcOpenShell/IfcOpenShell into presentationlayer

This commit is contained in:
ofskrand
2020-11-04 07:57:40 +01:00
11 changed files with 262 additions and 98 deletions
+10 -12
View File
@@ -2,6 +2,7 @@ import json
import os
import csv
import ifcopenshell
import ifcopenshell.util.pset
from pathlib import Path
from . import export_ifc
from . import schema
@@ -449,29 +450,25 @@ def refreshReferences(self, context):
context.scene.BIMProperties.classification_references.root = ""
# TODO: move into util module. See bug #971
def getPsetNames(self, context):
global psetnames_enum
psetnames_enum.clear()
if "/" in context.active_object.name and context.active_object.name.split("/")[0] in schema.ifc.elements:
empty = ifcopenshell.file()
element = empty.create_entity(context.active_object.name.split("/")[0])
for ifc_class, pset_names in schema.ifc.applicable_psets.items():
if element.is_a(ifc_class):
psetnames_enum.extend([(p, p, "") for p in pset_names])
pset_names = ifcopenshell.util.pset.get_applicable_psetqtos(
bpy.context.scene.BIMProperties.export_schema, context.active_object.name.split("/")[0], is_pset=True
)
psetnames_enum.extend([(p, p, "") for p in pset_names])
return psetnames_enum
# TODO: move into util module. See bug #971
def getQtoNames(self, context):
global qtonames_enum
qtonames_enum.clear()
if "/" in context.active_object.name and context.active_object.name.split("/")[0] in schema.ifc.elements:
empty = ifcopenshell.file()
element = empty.create_entity(context.active_object.name.split("/")[0])
for ifc_class, qto_names in schema.ifc.applicable_qtos.items():
if element.is_a(ifc_class):
qtonames_enum.extend([(q, q, "") for q in qto_names])
qto_names = ifcopenshell.util.pset.get_applicable_psetqtos(
bpy.context.scene.BIMProperties.export_schema, context.active_object.name.split("/")[0], is_qto=True
)
qtonames_enum.extend([(q, q, "") for q in qto_names])
return qtonames_enum
@@ -1625,6 +1622,7 @@ class BoundaryCondition(PropertyGroup):
class BIMObjectProperties(PropertyGroup):
is_reassigning_class: BoolProperty(name="Is Reassigning Class")
global_ids: CollectionProperty(name="GlobalIds", type=GlobalId)
attributes: CollectionProperty(name="Attributes", type=Attribute)
relating_type: PointerProperty(name="Type Product", type=bpy.types.Object)