Skip to content

Commit

Permalink
Draft: Upgrade: make compound when unable to turn edges to wire - fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Feb 3, 2022
1 parent d6d7c4f commit 8492cfb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Mod/Draft/draftfunctions/upgrade.py
Expand Up @@ -352,6 +352,9 @@ def makeWires(objectslist):
except Part.OCCError:
return None
else:
if (len(objectslist) > 1) and (len(wires) == len(objectslist)):
# we still have the same number of objects, we actually didn't join anything!
return makeCompound(objectslist)
for wire in wires:
newobj = doc.addObject("Part::Feature", "Wire")
newobj.Shape = wire
Expand Down Expand Up @@ -504,7 +507,10 @@ def makeWires(objectslist):
elif len(objects) > 1 and len(edges) > 1:
result = makeWires(objects)
if result:
_msg(translate("draft","Found several wires or edges: wiring them"))
if result == True:
_msg(translate("draft","Found several wires or edges: wiring them"))
else:
_msg(translate("draft","Found several non-treatable objects: creating compound"))
# special case, we have only one open wire. We close it,
# unless it has only 1 edge!
elif len(objects) == 1 and len(openwires) == 1:
Expand Down

0 comments on commit 8492cfb

Please sign in to comment.