[ArchComponent] Fix Link Of Window Hosts if empty got error as Wall Child

This commit is contained in:
paul lee
2021-01-18 02:08:39 +08:00
parent 625502bb47
commit ed15b99a40

View File

@@ -757,8 +757,8 @@ class Component(ArchIFC.IfcProduct):
subs = obj.Subtractions
for link in obj.InListRecursive:
if hasattr(link,"Hosts"):
for host in link.Hosts:
if host == obj:
if link.Hosts:
if obj in link.Hosts:
subs.append(link)
elif hasattr(link,"Host") and Draft.getType(link) != "Rebar":
if link.Host == obj:
@@ -1120,14 +1120,15 @@ class Component(ArchIFC.IfcProduct):
"""
hosts = []
for link in obj.InListRecursive:
if hasattr(link,"Host"):
if link.Host:
if link.Host == obj:
hosts.append(link)
elif hasattr(link,"Hosts"):
for host in link.Hosts:
if host == obj:
if link.Hosts:
if obj in link.Hosts:
hosts.append(link)
return hosts