[Draft] Eliminate default value modification
This commit is contained in:
@@ -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."))
|
||||
|
||||
Reference in New Issue
Block a user