Add an option to export a symbol's texts as DXF block attributes (#1339)

With symbols as blocks and the new "DXF : textes des symboles en
attributs" option (--dxf-attributes on the command line), a symbol's own
texts (its label, function, comment...) are attributes of its INSERT
instead of loose texts, so a CAD program moves them with the symbol and
can list or edit them. Each is written exactly where, and as, the text
was. A text showing an information field is tagged with its name
(LABEL, FUNCTION...), a typed text TEXT1, TEXT2...; a text's second line
gets _2. The block defines each tag once, placed where the first symbol
has it.

Its own option, off by default, because LibreCAD (2.2.1.5) does not
show attributes: the labels would vanish there. AutoCAD shows them.

The text geometry moves into textLines(), shared with the text loop,
so the attributes and the plain texts cannot drift apart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ispyisail
2026-10-07 09:56:26 +13:00
parent c3ed2daca8
commit 9699b314b0
11 changed files with 266 additions and 43 deletions
+5
View File
@@ -38,6 +38,7 @@ ExportProperties::ExportProperties() :
draw_bg_transparent(false),
draw_colored_conductors(true),
dxf_blocks(false),
dxf_attributes(false),
exported_area(QET::BorderArea)
{
}
@@ -80,6 +81,8 @@ void ExportProperties::toSettings(QSettings &settings,
draw_colored_conductors);
settings.setValue(prefix % "dxfblocks",
dxf_blocks);
settings.setValue(prefix % "dxfattributes",
dxf_attributes);
settings.setValue(prefix % "area",
QET::diagramAreaToString(exported_area));
}
@@ -120,6 +123,8 @@ void ExportProperties::fromSettings(QSettings &settings,
true ).toBool();
dxf_blocks = settings.value(prefix % "dxfblocks",
false).toBool();
dxf_attributes = settings.value(prefix % "dxfattributes",
false).toBool();
exported_area = QET::diagramAreaFromString(
settings.value(