Allow you to select person and organisation when exporting owner history metadata

This commit is contained in:
Dion Moult
2020-01-03 15:53:57 +11:00
parent d6b9810b94
commit 403cda5bc8
6 changed files with 126 additions and 34 deletions
+24
View File
@@ -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)