[Draft.draftutils.groups] get_windows() to support Links

FC Forum Discussion - https://forum.freecadweb.org/viewtopic.php?f=23&t=55438
This commit is contained in:
paul lee
2021-02-12 09:59:28 +08:00
parent 57fd294391
commit 0e81e76f7d
2 changed files with 3 additions and 5 deletions

View File

@@ -379,7 +379,7 @@ def getSVG(source,
drafts.append(o)
elif not o.isDerivedFrom("App::DocumentObjectGroup"):
nonspaces.append(o)
if Draft.getType(o) == "Window":
if Draft.getType(o) == "Window": # (Draft.getType(o.getLinkedObject()) == "Window") or (Draft.
windows.append(o)
objs = nonspaces

View File

@@ -146,9 +146,8 @@ def get_windows(obj):
if utils.get_type(obj) in ("Wall", "Structure"):
for o in obj.OutList:
out.extend(get_windows(o))
for i in obj.InList:
if (utils.get_type(i) == "Window"
if (utils.get_type(i.getLinkedObject()) == "Window"
or utils.is_clone(obj, "Window")):
if hasattr(i, "Hosts"):
if obj in i.Hosts:
@@ -158,8 +157,7 @@ def get_windows(obj):
if hasattr(i, "Host"):
if obj == i.Host:
out.append(i)
elif (utils.get_type(obj) in ("Window", "Rebar")
elif (utils.get_type(obj.getLinkedObject()) in ("Window", "Rebar")
or utils.is_clone(obj, ["Window", "Rebar"])):
out.append(obj)