mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 22:22:26 +00:00
Minor BCF fix
This commit is contained in:
@@ -16,12 +16,14 @@ def load(filepath):
|
|||||||
bcfxml = BcfXml()
|
bcfxml = BcfXml()
|
||||||
bcfxml.filepath = filepath
|
bcfxml.filepath = filepath
|
||||||
return bcfxml
|
return bcfxml
|
||||||
else:
|
elif version_id == "3.0":
|
||||||
from bcf.v3.bcfxml import BcfXml
|
from bcf.v3.bcfxml import BcfXml
|
||||||
|
|
||||||
bcfxml = BcfXml()
|
bcfxml = BcfXml()
|
||||||
bcfxml.filepath = filepath
|
bcfxml.filepath = filepath
|
||||||
return bcfxml
|
return bcfxml
|
||||||
|
else:
|
||||||
|
raise Exception(f"Version {version_id} not supported.")
|
||||||
|
|
||||||
|
|
||||||
def get_version(version_path):
|
def get_version(version_path):
|
||||||
|
|||||||
@@ -151,10 +151,10 @@ class BcfXml:
|
|||||||
if value in data["Topic"]:
|
if value in data["Topic"]:
|
||||||
setattr(topic, key, data["Topic"][value])
|
setattr(topic, key, data["Topic"][value])
|
||||||
|
|
||||||
if "ReferenceLinks" in data["Topic"]:
|
if data["Topic"].get("ReferenceLinks"):
|
||||||
topic.reference_links.extend(data["Topic"]["ReferenceLinks"].get("ReferenceLink", []))
|
topic.reference_links.extend(data["Topic"]["ReferenceLinks"].get("ReferenceLink", []))
|
||||||
|
|
||||||
if "Labels" in data["Topic"]:
|
if data["Topic"].get("Labels"):
|
||||||
topic.labels.extend(data["Topic"]["Labels"].get("Label", []))
|
topic.labels.extend(data["Topic"]["Labels"].get("Label", []))
|
||||||
|
|
||||||
if "BimSnippet" in data["Topic"]:
|
if "BimSnippet" in data["Topic"]:
|
||||||
|
|||||||
Reference in New Issue
Block a user