Design properties: project, author and licence in the design, its exports and inspect_design (#1015) (#1189)
A design carries metadata (format 21): project, part number, revision, author, organization, description and license, plus other tools' data under reverse-DNS keys, kept as written. Edited in the Design Properties window (Document Settings), set by document.metadata.set, reported by inspect_design, and written into STEP, IGES and 3MF where the format has a place for them. Translated, with tests.
This commit is contained in:
1 parent
78079587ad
commit
a4a8b48567
33 files changed
+1106
-21
No files matched your search
@@ -242,6 +242,18 @@ fn parameters_drive_the_design() {
|
||||
assert!(d["params"].as_array().unwrap().iter().any(|p| p["name"] == "len" && p["value"] == 50.0), "{d}");
|
||||
}
|
||||
|
||||
/// Design properties (#1015) are set through `execute` and come back in `inspect_design`.
|
||||
#[test]
|
||||
fn design_properties_show_in_inspect_design() {
|
||||
let mut s = server();
|
||||
let d = tool(&mut s, "inspect_design", json!({"measure": false, "sketches": false}));
|
||||
assert_eq!(d["metadata"], json!({}), "{d}");
|
||||
let params = json!({"values": {"author": "Agent", "com.example.agent": {"session": 7}}});
|
||||
tool(&mut s, "execute", json!({"command": "document.metadata.set", "params": params}));
|
||||
let d = tool(&mut s, "inspect_design", json!({"measure": false, "sketches": false}));
|
||||
assert_eq!(d["metadata"], json!({"author": "Agent", "com.example.agent": {"session": 7}}), "{d}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn batch_stops_at_first_error_and_rolls_back() {
|
||||
let mut s = server();
|
||||
|
||||
Reference in new issue
Block a user