freecad-cam/Mod/Draft/draftmake
2026-02-01 01:59:24 +01:00
..
__pycache__ init 2026-02-01 01:59:24 +01:00
__init__.py init 2026-02-01 01:59:24 +01:00
make_arc_3points.py init 2026-02-01 01:59:24 +01:00
make_array.py init 2026-02-01 01:59:24 +01:00
make_bezcurve.py init 2026-02-01 01:59:24 +01:00
make_block.py init 2026-02-01 01:59:24 +01:00
make_bspline.py init 2026-02-01 01:59:24 +01:00
make_circle.py init 2026-02-01 01:59:24 +01:00
make_circulararray.py init 2026-02-01 01:59:24 +01:00
make_clone.py init 2026-02-01 01:59:24 +01:00
make_copy.py init 2026-02-01 01:59:24 +01:00
make_dimension.py init 2026-02-01 01:59:24 +01:00
make_ellipse.py init 2026-02-01 01:59:24 +01:00
make_facebinder.py init 2026-02-01 01:59:24 +01:00
make_fillet.py init 2026-02-01 01:59:24 +01:00
make_hatch.py init 2026-02-01 01:59:24 +01:00
make_label.py init 2026-02-01 01:59:24 +01:00
make_layer.py init 2026-02-01 01:59:24 +01:00
make_line.py init 2026-02-01 01:59:24 +01:00
make_orthoarray.py init 2026-02-01 01:59:24 +01:00
make_patharray.py init 2026-02-01 01:59:24 +01:00
make_point.py init 2026-02-01 01:59:24 +01:00
make_pointarray.py init 2026-02-01 01:59:24 +01:00
make_polararray.py init 2026-02-01 01:59:24 +01:00
make_polygon.py init 2026-02-01 01:59:24 +01:00
make_rectangle.py init 2026-02-01 01:59:24 +01:00
make_shape2dview.py init 2026-02-01 01:59:24 +01:00
make_shapestring.py init 2026-02-01 01:59:24 +01:00
make_sketch.py init 2026-02-01 01:59:24 +01:00
make_text.py init 2026-02-01 01:59:24 +01:00
make_wire.py init 2026-02-01 01:59:24 +01:00
make_wpproxy.py init 2026-02-01 01:59:24 +01:00
README.md init 2026-02-01 01:59:24 +01:00

2020 May

These modules contain the basic functions to create custom "scripted objects" defined within the workbench.

Each scripted object has a "make function" like make_rectangle, a proxy class like Rectangle, and a viewprovider class like ViewProviderRectangle. Each make function should import the two corresponding classes in order to create a new object with the correct data and visual properties for that object. These classes should be defined in the modules in draftobjects/ and draftviewproviders/.

The make functions can be used in both graphical and non-graphical modes (terminal only); in the latter case the viewprovider is not used. The functions are also used internally by the graphical "GuiCommands" (buttons, menu actions) defined in the modules in draftguitools/ and drafttaskpanels/.

These make functions were previously defined in the Draft.py module, which was very large. Now Draft.py just loads the individual modules in order to provide these functions under the Draft namespace.

import Draft

new_obj1 = Draft.make_rectangle(...)
new_obj2 = Draft.make_circle(...)
new_obj3 = Draft.make_line(...)

The functions in the Draft namespace are considered to be the public application programming interface (API) of the workbench, and should be usable in scripts, macros, and other workbenches.

For more information see the thread: [Discussion] Splitting Draft tools into their own modules