XCLIP and CLIP: clip boundaries on block references, CLIP routed by the picked object

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ramox81andClaude Opus 5.5 committed 2026-09-24 19:39:09 +03:00
1 parent c1ecb0edaf
commit 2078fc02f8
10 files changed
+947 -16

No files matched your search

+32 -2
View File
@@ -715,9 +715,39 @@ impl OpenCADStudio {
Err(_) => self.command_line.push_error(&format!("{path} not found.")),
}
}
"PDFCLIP" | "CLIP" => {
"PDFCLIP" => {
use crate::command::CadCommand;
let command = crate::modules::insert::pdf_clip::PdfClipCommand::new(cmd == "CLIP");
let command = crate::modules::insert::pdf_clip::PdfClipCommand::new();
self.command_line.push_info(&command.prompt());
self.tabs[i].active_cmd = Some(Box::new(command));
}
"CLIP" => {
use crate::command::CadCommand;
let command = crate::modules::insert::xclip::ClipCommand::new();
self.command_line.push_info(&command.prompt());
self.tabs[i].active_cmd = Some(Box::new(command));
}
// XCLIP takes block references chosen beforehand; others are
// left out.
"XCLIP" => {
use crate::command::CadCommand;
use crate::modules::insert::xclip::XclipCommand;
let inserts: Vec<acadrust::Handle> = self.tabs[i]
.scene
.selected_entities()
.iter()
.filter(|(_, e)| matches!(e, acadrust::EntityType::Insert(_)))
.map(|(h, _)| *h)
.collect();
let command = if inserts.is_empty() {
XclipCommand::new()
} else {
let clipped = inserts.iter().any(|h| {
crate::scene::pick::xclip::filter_handle(&self.tabs[i].scene.document, *h)
.is_some()
});
XclipCommand::for_inserts(inserts, clipped)
};
self.command_line.push_info(&command.prompt());
self.tabs[i].active_cmd = Some(Box::new(command));
}