[Draft] Eliminate default value modification

This commit is contained in:
Chris Hennes
2021-10-11 21:28:55 -05:00
parent 9cbfe835f3
commit 7a5fb042f7

View File

@@ -509,7 +509,7 @@ def make_radial_dimension_obj(edge_object, index=1, mode="radius",
def make_angular_dimension(center=App.Vector(0, 0, 0),
angles=[0, 90],
angles=None, # If None, set to [0,90]
dim_line=App.Vector(10, 10, 0), normal=None):
"""Create an angular dimension from the given center and angles.
@@ -555,6 +555,10 @@ def make_angular_dimension(center=App.Vector(0, 0, 0),
_name = "make_angular_dimension"
utils.print_header(_name, "Angular dimension")
# Prevent later modification of a default parameter by using a placeholder
if angles is None:
angles = [0, 90]
found, doc = utils.find_doc(App.activeDocument())
if not found:
_err(translate("draft","No active document. Aborting."))