Skip to content

Commit 003acdb

Browse files
committed
Add SetLabel command
1 parent 8f6a99d commit 003acdb

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

modeling-cmds/src/def_enum.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1727,12 +1727,23 @@ define_modeling_cmd_enum! {
17271727
/// Which units the `value` field uses.
17281728
pub units: units::UnitLength,
17291729
}
1730+
17301731
/// Set the grid lines to auto scale. The grid will get larger the further you zoom out,
17311732
/// and smaller the more you zoom in.
17321733
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]
17331734
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
17341735
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1735-
pub struct SetGridAutoScale {
1736+
pub struct SetGridAutoScale {}
1737+
1738+
/// Apply a label to an object.
1739+
#[derive(Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant)]
1740+
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
1741+
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
1742+
pub struct SetLabel {
1743+
/// The object to be labeled.
1744+
pub object_id: Uuid,
1745+
/// Label to be set. Sending empty string will unset the label.
1746+
pub label: String,
17361747
}
17371748
}
17381749
}

modeling-cmds/src/ok_response.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,12 +945,17 @@ define_ok_modeling_cmd_response_enum! {
945945
pub extra_solid_ids: Vec<Uuid>,
946946
}
947947

948+
948949
/// The response from the 'SetGridScale'.
949950
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
950951
pub struct SetGridScale {}
951952

952953
/// The response from the 'SetGridScale'.
953954
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
954955
pub struct SetGridAutoScale {}
956+
957+
/// The response from the 'SetLabel' command.
958+
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
959+
pub struct SetLabel {}
955960
}
956961
}

0 commit comments

Comments
 (0)