mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 17:57:02 +00:00
Allow you to select person and organisation when exporting owner history metadata
This commit is contained in:
@@ -36,6 +36,8 @@ documents_enum = []
|
||||
contexts_enum = []
|
||||
subcontexts_enum = []
|
||||
target_views_enum = []
|
||||
persons_enum = []
|
||||
organisations_enum = []
|
||||
|
||||
@persistent
|
||||
def setDefaultProperties(scene):
|
||||
@@ -92,6 +94,26 @@ def getIfcClasses(self, context):
|
||||
return classes_enum
|
||||
|
||||
|
||||
def getPersons(self, context):
|
||||
global persons_enum
|
||||
if len(persons_enum) < 1:
|
||||
persons_enum.clear()
|
||||
with open(os.path.join(self.data_dir, 'owner', 'person.json'), 'r') as f:
|
||||
persons = json.load(f)
|
||||
persons_enum.extend([(p['Identification'], p['Identification'], '') for p in persons])
|
||||
return persons_enum
|
||||
|
||||
|
||||
def getOrganisations(self, context):
|
||||
global organisations_enum
|
||||
if len(organisations_enum) < 1:
|
||||
organisations_enum.clear()
|
||||
with open(os.path.join(self.data_dir, 'owner', 'organisation.json'), 'r') as f:
|
||||
organisations = json.load(f)
|
||||
organisations_enum.extend([(o['Name'], o['Name'], '') for o in organisations])
|
||||
return organisations_enum
|
||||
|
||||
|
||||
def getPsetNames(self, context):
|
||||
global psetnames_enum
|
||||
if len(psetnames_enum) < 1:
|
||||
@@ -215,6 +237,8 @@ class BIMProperties(PropertyGroup):
|
||||
import_should_use_legacy: BoolProperty(name="Import with Legacy Importer", default=False)
|
||||
import_should_use_cpu_multiprocessing: BoolProperty(name="Import with CPU Multiprocessing", default=False)
|
||||
qa_reject_element_reason: StringProperty(name="Element Rejection Reason")
|
||||
person: EnumProperty(items=getPersons, name="Person")
|
||||
organisation: EnumProperty(items=getOrganisations, name="Organisation")
|
||||
pset_name: EnumProperty(items=getPsetNames, name="Pset Name", update=refreshPsetFiles)
|
||||
pset_file: EnumProperty(items=getPsetFiles, name="Pset File")
|
||||
has_georeferencing: BoolProperty(name="Has Georeferencing", default=False)
|
||||
|
||||
Reference in New Issue
Block a user