Arch: Simplify some ifs in ArchComponent

This commit does not change behavior.
This commit is contained in:
Matthijs Kooijman
2021-05-22 17:28:39 +02:00
parent dbd7dbd332
commit 2bbcb4994a

View File

@@ -737,20 +737,18 @@ class Component(ArchIFC.IfcProduct):
base = base.fuse(add)
elif hasattr(o,'Shape'):
if o.Shape:
if not o.Shape.isNull():
if o.Shape.Solids:
s = o.Shape.copy()
if placement:
s.Placement = s.Placement.multiply(placement)
if base:
if base.Solids:
try:
base = base.fuse(s)
except Part.OCCError:
print("Arch: unable to fuse object ", obj.Name, " with ", o.Name)
else:
base = s
if o.Shape and not o.Shape.isNull() and o.Shape.Solids:
s = o.Shape.copy()
if placement:
s.Placement = s.Placement.multiply(placement)
if base:
if base.Solids:
try:
base = base.fuse(s)
except Part.OCCError:
print("Arch: unable to fuse object ", obj.Name, " with ", o.Name)
else:
base = s
# treat subtractions
subs = obj.Subtractions
@@ -1420,11 +1418,7 @@ class ViewProviderComponent:
if hasattr(self,"Object"):
c = []
if hasattr(self.Object,"Base"):
if Draft.getType(self.Object) != "Wall":
c = [self.Object.Base]
elif Draft.getType(self.Object.Base) == "Space":
c = []
else:
if not (Draft.getType(self.Object) == "Wall" and Draft.getType(self.Object.Base) == "Space"):
c = [self.Object.Base]
if hasattr(self.Object,"Additions"):
c.extend(self.Object.Additions)