mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 02:31:09 +00:00
WIP partial port of IfcPerson to partial editing. New feature too! See message. See #1222.
* Previously, IfcPerson was not imported. Now it is! Funky.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
|
||||
|
||||
class Data:
|
||||
is_loaded = False
|
||||
people = {}
|
||||
|
||||
@classmethod
|
||||
def load(cls):
|
||||
file = IfcStore.get_file()
|
||||
if not file:
|
||||
return
|
||||
cls.people = {}
|
||||
for person in file.by_type("IfcPerson"):
|
||||
data = person.get_info()
|
||||
|
||||
roles = {}
|
||||
if data["Roles"]:
|
||||
for role in data["Roles"]:
|
||||
roles[role.id()] = role.get_info()
|
||||
data["Roles"] = roles
|
||||
|
||||
addresses = []
|
||||
if data["Addresses"]:
|
||||
for address in data["Addresses"]:
|
||||
addresses.append(address.get_info())
|
||||
data["Addresses"] = addresses
|
||||
|
||||
data["is_engaged"] = bool(person.EngagedIn)
|
||||
|
||||
cls.people[person.id()] = data
|
||||
cls.is_loaded = True
|
||||
Reference in New Issue
Block a user