-
Notifications
You must be signed in to change notification settings - Fork 18
pydim.create_angular_dimension
fabian-flassig edited this page Jul 31, 2026
·
1 revision
Creates an angle dimension between two edges — or, if the edges are parallel, an edge-distance dimension.
Similar to the Dimensions -> Angle and Dimensions -> Edges functions in the PYTHA user interface (both are the same dimension internally; the type is chosen automatically from the edge geometry).
pydim.create_angular_dimension(point1, point2, point3, point4 [,options])Each edge is described by its two end coordinates: point1/point2 form the first edge, point3/point4 the second edge. The coordinates are resolved to an existing part edge; an edge always lies completely within one part.
| Parameter | Type | Description |
|---|---|---|
point1 |
{{x,y,z} [,part]} |
First end of the first edge: the coordinate at index 1 and, optionally, a part element handle at index 2 that restricts the edge search to that part. |
point2 |
{{x,y,z} [,part]} |
Second end of the first edge. If both points of an edge carry a part handle, it must be the same part. |
point3 |
{{x,y,z} [,part]} |
First end of the second edge. |
point4 |
{{x,y,z} [,part]} |
Second end of the second edge. |
options |
{...} |
Optional: a table that may contain the following options: |
options.view |
string |
The view in which the dimension is displayed: "xy", "-xy", "xz", "-xz", "yz", "-yz" or "axo" (default "axo"). |
options.distance |
number |
Radius of the angle arc around the corner point — for parallel edges the position of the dimension line along the edges (default 0). |
options.style_file |
path handle |
A dimension style file used as base style, see pydim.create_linear_dimension. |
options.style |
{...} |
Individual style settings applied on top; the keys are listed at pydim.create_linear_dimension. |
| Type | Description |
|---|---|
element_handle |
An element handle of type "dimension" for the new dimension — or nil if no part edge matches one of the coordinate pairs or the dimension is degenerate. |
Angle between the base and the slope of a triangular plate:
local tri = pytha.create_polygon({{2100, 0, 0}, {2600, 0, 0}, {2600, 300, 0}})
pydim.create_angular_dimension(
{{2100, 0, 0}, tri}, {{2600, 0, 0}, tri}, -- first edge: base
{{2100, 0, 0}, tri}, {{2600, 300, 0}, tri}, -- second edge: slope
{view = "xy", distance = 150})Distance between two parallel edges (the Edges dimension):
local part = pytha.create_block(600, 400, 300)
pydim.create_angular_dimension(
{{0, 0, 0}, part}, {{600, 0, 0}, part},
{{0, 0, 300}, part}, {{600, 0, 300}, part},
{view = "xz", distance = 100})- Parallel edges automatically yield an edge-distance dimension, non-parallel edges an angle dimension.
- The two coordinate pairs must resolve to two different edges.
- Dimensions are created in the model, not on plot sheets.
Minimum PYTHA Version: V27
pydim, element handles, create_linear_dimension, create_perpendicular_dimension