-
Notifications
You must be signed in to change notification settings - Fork 18
pydim.get_text
fabian-flassig edited this page Aug 25, 2026
·
1 revision
Reads the content, the placement and the appearance of a 2d annotation text.
pydim.get_text(text)| Parameter | Type | Description |
|---|---|---|
text |
element_handle |
An element handle of type "text", e.g. from pydim.create_text. |
| Type | Description |
|---|---|
table |
A table describing the text: |
| Key | Type | Description |
|---|---|---|
text |
string |
The text content. |
view |
string |
The view the text is displayed in. Absent for views the Lua API does not expose (perspective). |
orientation |
string |
The point of the text box that sits on the text position, see pydim.create_text. |
angle |
number |
Rotation of the text in degrees. |
position |
{x,y} |
Position of the text in the plane of the view, in object units. For an anchored text this is the offset from its anchor point, not an absolute position. |
attached_to |
element_handle |
The part the text is anchored to and follows. Absent for a free text. |
leader_count |
number |
Number of leaders attached to the text. |
style |
{...} |
The appearance: size, aspect_ratio, width, font, pen, layer, bold, italic, underline and in_object_units, with the meaning described in pydim.create_text. |
local t = pydim.create_text("12", {{600, 400, 0}}, {view = "xy", leader = true})
local info = pydim.get_text(t)
pyui.alert(string.format("%s in %s, %d leader(s), height %g",
info.text, info.view, info.leader_count, info.style.size))
if info.attached_to then
pyui.alert("follows part " .. tostring(info.attached_to:get_element_type()))
end-
positionandstyle.size/style.widthare in the unitstyle.in_object_unitsselects. -
leader_countmay be greater than 1: Lua creates at most one leader per text, but further leaders can be added interactively withText -> Leader at text.
Minimum PYTHA Version: V27
pydim, pydim.create_text, pydim.update_text, element handles