forked from 1b-agent/opencadstudio-upstream
The refused-path message split its format string across a raw line break; it uses \n. The reference-length and new-length prompts SWEEP no longer shows leave the catalog and all 21 locales. Lines past the width limit in the UPDATEFIELD and automation select changes are wrapped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
737981791b
commit
41d93b6f54
25 files changed
+22
-120
No files matched your search
+16
-5
@@ -202,18 +202,23 @@ fn serve_socket_with_idle(
|
||||
|
||||
/// The entities inside block definitions: owned by (or listed in) a block
|
||||
/// record that is not a layout's model or paper space.
|
||||
fn definition_members(document: &codec::CadDocument) -> std::collections::HashSet<codec::Handle> {
|
||||
fn definition_members(
|
||||
document: &codec::CadDocument,
|
||||
) -> std::collections::HashSet<codec::Handle> {
|
||||
let mut layouts: std::collections::HashSet<codec::Handle> = document
|
||||
.objects
|
||||
.values()
|
||||
.filter_map(|object| match object {
|
||||
codec::objects::ObjectType::Layout(layout) if !layout.block_record.is_null() => Some(layout.block_record),
|
||||
codec::objects::ObjectType::Layout(layout) if !layout.block_record.is_null() => {
|
||||
Some(layout.block_record)
|
||||
}
|
||||
_ => None,
|
||||
})
|
||||
.collect();
|
||||
layouts.extend(document.block_records.iter().filter_map(|record| {
|
||||
let name = record.name.to_ascii_uppercase();
|
||||
(name.starts_with("*MODEL_SPACE") || name.starts_with("*PAPER_SPACE")).then_some(record.handle)
|
||||
(name.starts_with("*MODEL_SPACE") || name.starts_with("*PAPER_SPACE"))
|
||||
.then_some(record.handle)
|
||||
}));
|
||||
let definitions: std::collections::HashSet<codec::Handle> = document
|
||||
.block_records
|
||||
@@ -838,7 +843,10 @@ impl OpenCADStudio {
|
||||
arr.iter()
|
||||
.filter_map(|h| h.as_str())
|
||||
.filter_map(|h| {
|
||||
let h = h.strip_prefix("0x").or_else(|| h.strip_prefix("0X")).unwrap_or(h);
|
||||
let h = h
|
||||
.strip_prefix("0x")
|
||||
.or_else(|| h.strip_prefix("0X"))
|
||||
.unwrap_or(h);
|
||||
u64::from_str_radix(h, 16).ok().map(codec::Handle::new)
|
||||
})
|
||||
.collect()
|
||||
@@ -881,7 +889,10 @@ impl OpenCADStudio {
|
||||
let handles: Vec<codec::Handle> = scene
|
||||
.document
|
||||
.entities()
|
||||
.filter(|e| e.common().owner_handle == space || listed.contains(&e.common().handle))
|
||||
.filter(|e| {
|
||||
e.common().owner_handle == space
|
||||
|| listed.contains(&e.common().handle)
|
||||
})
|
||||
.filter(|e| type_filter.is_none_or(|t| entity_type_matches(e, t)))
|
||||
.filter(|e| layer_filter.is_none_or(|l| e.common().layer == l))
|
||||
.map(|e| e.common().handle)
|
||||
|
||||
@@ -580,9 +580,9 @@ impl OpenCADStudio {
|
||||
.collect();
|
||||
let hosting = hosts.iter().any(|h| match doc.get_entity(*h) {
|
||||
Some(entity) => crate::entities::field::hosts_field(doc, entity),
|
||||
None => attributes
|
||||
.iter()
|
||||
.any(|common| common.handle == *h && crate::entities::field::common_hosts_field(doc, common)),
|
||||
None => attributes.iter().any(|common| {
|
||||
common.handle == *h && crate::entities::field::common_hosts_field(doc, common)
|
||||
}),
|
||||
});
|
||||
if !hosting {
|
||||
self.command_line.push_output(&crate::tf!("{found} field(s) found.", found = 0));
|
||||
|
||||
@@ -4464,11 +4464,6 @@ pub(super) fn message_attribute(source: &str) -> Option<(&'static str, &'static
|
||||
"SWEEP Align sweep object perpendicular to path [Yes/No]" => Some(("insert", "sweep-align-sweep-object-perpendicular-to-path-yes-no")),
|
||||
"SWEEP Specify base point:" => Some(("insert", "sweep-specify-base-point")),
|
||||
"SWEEP Enter scale factor or [Reference/Expression]" => Some(("insert", "sweep-enter-scale-factor-or-reference")),
|
||||
"SWEEP Specify reference length or first point" => Some(("insert", "sweep-specify-reference-length-or-first-point")),
|
||||
"SWEEP Specify second reference point:" => Some(("insert", "sweep-specify-second-reference-point")),
|
||||
"SWEEP Specify new length or [Points]" => Some(("insert", "sweep-specify-new-length-or-points")),
|
||||
"SWEEP Specify first point of new length:" => Some(("insert", "sweep-specify-first-point-of-new-length")),
|
||||
"SWEEP Specify second point of new length:" => Some(("insert", "sweep-specify-second-point-of-new-length")),
|
||||
"SWEEP Enter twist angle or allow banking for a non-planar sweep path [Bank/EXpression]" => Some(("insert", "sweep-specify-twist-angle-or-bank")),
|
||||
"SWEEP Enter expression:" => Some(("insert", "sweep-enter-expression")),
|
||||
"SWEEP Specify start reference length" => Some(("insert", "sweep-specify-start-reference-length")),
|
||||
|
||||
@@ -1838,8 +1838,9 @@ impl CadCommand for SweepCommand {
|
||||
if (self.options.scale - 1.0).abs() > 1e-12 {
|
||||
if let Some(message) = crate::scene::model::sweep_model::scaled_sweep_path_refusal(&path) {
|
||||
return CmdResult::ReportMeasurement(format!(
|
||||
"{}
|
||||
{}", t!(message), t!("The selected path curve is not valid."),
|
||||
"{}\n{}",
|
||||
t!(message),
|
||||
t!("The selected path curve is not valid."),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user