Merge PR #1590 from ramox81/codex/field-table-placeholders: table formula buttons, block placeholders, attribute fields on insert, plot-time fields

The PR pinned the codec to its fork through [patch]; codec #81 is merged
upstream and main already points at it, so the patch section is dropped.
This commit is contained in:
Hakan Seven committed 2026-10-02 20:09:27 +03:00
commit 29ed1cae9b
29 files changed
+524 -12

No files matched your search

+8
View File
@@ -475,6 +475,7 @@ impl OpenCADStudio {
if !path.to_ascii_lowercase().ends_with(".pdf") {
return Err(failure("invalid_path", "plot writes .pdf files"));
}
self.stamp_plot_fields();
let i = self.active_tab;
let names = self.tabs[i].scene.layout_names();
let requested = req["layout"].as_str().unwrap_or("Model").to_owned();
@@ -1132,6 +1133,13 @@ impl OpenCADStudio {
"link_text" => F::HyperlinkText(v.into()),
"link_url" => F::HyperlinkUrl(v.into()),
"plot_scale" => F::PlotScale(index(codec::fields::PLOT_SCALE_FORMATS.len())?),
"placeholder" => F::PlaceholderProperty(index(codec::fields::BLOCK_PLACEHOLDER_PROPERTIES.len())?),
"table_function" => F::TableFunction(
["Average", "Sum", "Count", "Cell"]
.into_iter()
.find(|f| f.eq_ignore_ascii_case(v))
.ok_or_else(|| failure("invalid_value", "Average|Sum|Count|Cell"))?,
),
_ => return Err(failure("invalid_value", "Unknown field dialog key")),
})
}