Skip to content

Commit

Permalink
[Draft] Eliminate default value modification
Browse files Browse the repository at this point in the history
  • Loading branch information
chennes committed Oct 12, 2021
1 parent 9cbfe83 commit 7a5fb04
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Mod/Draft/draftmake/make_dimension.py
Expand Up @@ -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.
Expand Down Expand Up @@ -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."))
Expand Down

0 comments on commit 7a5fb04

Please sign in to comment.