mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-28 13:24:14 +02:00
Add DXF export from the command line (--export-dxf)
qelectrotech --export-dxf <project.qet> <output_dir> [--show-terminals] writes one DXF per folio, named <NN>_<title>.dxf like the PNG and SVG exports. Discussion #1072. The DXF code moves out of ExportDialog into DxfExport, unchanged except that its options come from an ExportProperties argument instead of the dialog. The dialog and the command line both call it, and the command line uses the dialog's default options (the preferences' export settings), so both write the same entities. - Createdxf answers a file it cannot open with a message box and exit(0); the command line checks the file first and fails with a message and exit code 1 instead. - A note is printed when pictures become outline boxes, as the dialog warns. - Scripting: qet.exportDxf(outDir, showTerminals). MCP: format "dxf". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G2d2Zi8BfrYRPX88zhaoFG
This commit is contained in:
@@ -207,6 +207,13 @@ bool QetScriptApi::exportSvg(const QString &outDir, bool showTerminals)
|
||||
return runFlag(QStringLiteral("--export-svg"), args);
|
||||
}
|
||||
|
||||
bool QetScriptApi::exportDxf(const QString &outDir, bool showTerminals)
|
||||
{
|
||||
QStringList args{outDir};
|
||||
if (showTerminals) args << QStringLiteral("--show-terminals");
|
||||
return runFlag(QStringLiteral("--export-dxf"), args);
|
||||
}
|
||||
|
||||
bool QetScriptApi::exportCables(const QString &output)
|
||||
{
|
||||
return runFlag(QStringLiteral("--export-cables"), {output});
|
||||
|
||||
Reference in New Issue
Block a user