ucs: dynamic UCS on planar solid faces

With dynamic UCS on (UCSDETECT 1, toggled with F6), a command's first
point picked on a planar face of a solid sets the UCS to that face for
the rest of the command, so 2D commands draw on the face (#1711). An
unsnapped first point lands on the face itself; a snapped point off the
face's plane belongs to other geometry and leaves the UCS alone. The
previous UCS comes back when the command ends. UCS commands themselves
are left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-15 11:40:39 +03:00
1 parent 19ecf78bd9
commit cccea4008b
33 files changed
+193

No files matched your search

+1
View File
@@ -768,6 +768,7 @@ inventory::submit!(crate::command::CommandRegistration {
"FILEDIA",
"TRIMEXTENDMODE",
"SELECTIONCYCLING",
"UCSDETECT",
"SURFACEASSOCIATIVITY",
"LAYOUTCREATEVIEWPORT",
"FIELDEVAL",
+25
View File
@@ -1216,6 +1216,7 @@ impl OpenCADStudio {
| "FILEDIA"
| "TRIMEXTENDMODE"
| "SELECTIONCYCLING"
| "UCSDETECT"
| "SURFACEASSOCIATIVITY"
| "UCSORTHO"
| "UCSVIEW"
@@ -1656,6 +1657,30 @@ impl OpenCADStudio {
}
return Some(self.finish_dispatch(cmd));
}
if name == "UCSDETECT" {
let current = i16::from(self.dynamic_ucs);
let prompt = format!("Enter new value for UCSDETECT <{current}>:");
match value
.as_deref()
.map(|v| v.trim().parse::<i16>().ok().filter(|v| (0..=1).contains(v)))
{
Some(Some(mode)) => {
self.dynamic_ucs = mode == 1;
self.persist_settings_if_changed();
}
Some(None) => {
self.command_line
.push_error(crate::t!("Requires 0 or 1 only.").as_ref());
self.command_line.push_output(&prompt);
self.pending_setvar = Some(name.clone());
}
None => {
self.command_line.push_output(&prompt);
self.pending_setvar = Some(name.clone());
}
}
return Some(self.finish_dispatch(cmd));
}
if name == "SELECTIONCYCLING" {
// 1 and 2 both turn cycling on; the candidate list
// always shows.