Skip to content

Commit

Permalink
Arch: Fixed default component type for new windows
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed May 16, 2022
1 parent aa19e21 commit 3ec140f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Mod/Arch/ArchWindow.py
Expand Up @@ -96,15 +96,19 @@ def makeWindow(baseobj=None,width=None,height=None,parts=None,name=None):
else:
if baseobj:
if baseobj.getLinkedObject().isDerivedFrom("Part::Part2DObject"):
# create default component
if baseobj.Shape.Wires:
tp = "Frame"
if len(baseobj.Shape.Wires) == 1:
tp = "Panel"
i = 0
ws = ''
for w in baseobj.Shape.Wires:
if w.isClosed():
if ws: ws += ","
ws += "Wire" + str(i)
i += 1
obj.WindowParts = ["Default","Frame",ws,"1","0"]
obj.WindowParts = ["Default",tp,ws,"1","0"]
else:
# bind properties from base obj if existing
for prop in ["Height","Width","Subvolume","Tag","Description","Material"]:
Expand Down

2 comments on commit 3ec140f

@Roy-043
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tp = "Panel"
should be:
tp = "Solid panel"

@yorikvanhavre
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops good catch... Fixed in 73d28ac

Please sign in to comment.