Draft: move make_label function to its own module

Also perform several improvements such as PEP8 cleanup,
writing complete docstrings, type checking the input arguments,
and deprecating the older call.

Update `Draft.py`, the Gui Command, the unit test, and test script
as well.
This commit is contained in:
vocx-fc
2020-06-04 20:59:55 -05:00
committed by Yorik van Havre
parent f7e53eaab3
commit fa092ae3df
7 changed files with 394 additions and 102 deletions

View File

@@ -354,9 +354,10 @@ def _create_objects(doc=None,
_msg(16 * "-")
_msg("Label")
place = App.Placement(Vector(18500, 500, 0), App.Rotation())
label = Draft.make_label(targetpoint=Vector(18000, 0, 0),
distance=-250,
placement=place)
label = Draft.make_label(target_point=Vector(18000, 0, 0),
placement=place,
custom_text="Example label",
distance=-250)
label.Text = "Testing"
if App.GuiUp:
label.ViewObject.ArrowSize = 15