feat(hatch): HPASSOC sets whether new hatches are associative

HPASSOC (0 or 1, default 1) is the starting state of the hatch
command's associative option. It is an application setting: typed
directly or through SETVAR, it persists across sessions and does not
mark the drawing modified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-13 15:32:55 +03:00
1 parent dd45ac4039
commit 2ddf2a31da
6 files changed
+29 -1

No files matched your search

+2 -1
View File
@@ -764,7 +764,8 @@ impl OpenCADStudio {
});
let new_cmd =
HatchCommand::new(outlines, boundary_sources, selected, inherited, plane)
.with_origin(self.tabs[i].scene.document.hatch_origin());
.with_origin(self.tabs[i].scene.document.hatch_origin())
.with_associative(self.hatch_associative);
self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd));
self.refresh_area_preview(i);
+13
View File
@@ -1148,6 +1148,7 @@ impl OpenCADStudio {
| "SHORTCUTMENUDURATION"
| "CURSORSIZE"
| "PICKBOX"
| "HPASSOC"
| "CURSORTYPE"
| "SNAPANG"
| "TEXTFILL"
@@ -2188,6 +2189,17 @@ impl OpenCADStudio {
},
None => Ok((format!("PICKBOX = {}", self.pick_box), false)),
},
"HPASSOC" => match value.as_deref() {
Some(v @ ("0" | "1")) => {
self.hatch_associative = v == "1";
Ok((format!("HPASSOC = {v}"), true))
}
Some(_) => Err("SETVAR: 0 or 1 required.".into()),
None => Ok((
format!("HPASSOC = {}", u8::from(self.hatch_associative)),
false,
)),
},
"CURSORTYPE" => match &value {
Some(v) => match v.as_str() {
"0" => {
@@ -3134,6 +3146,7 @@ impl OpenCADStudio {
| "SHORTCUTMENUDURATION"
| "CURSORSIZE"
| "PICKBOX"
| "HPASSOC"
| "CURSORTYPE"
| "SNAPANG"
| "CLIPROMPTLINES"