Merge pull request #1175 from Ramox81

This commit is contained in:
Hakan Seven committed 2026-09-11 09:55:03 +03:00
commit 90af02664d
3 files changed
+16 -2

No files matched your search

+9 -2
View File
@@ -692,10 +692,17 @@ impl OpenCADStudio {
// ── OVERKILL — delete duplicate (identical) objects ──────────
// Removes objects that are identical in geometry AND properties to
// another object (compared with the handle ignored). Operates on
// the current selection, or the whole drawing when nothing is
// the current selection, gathering objects first when nothing is
// selected. Conservative: only exact duplicates are removed.
"OVERKILL" => {
use acadrust::Handle;
if self.tabs[i].scene.selected.is_empty() {
use crate::modules::draw::select::SelectObjectsCommand;
let selection = SelectObjectsCommand::new("OVERKILL");
self.command_line.push_info(&selection.prompt());
self.tabs[i].active_cmd = Some(Box::new(selection));
return Some(self.finish_dispatch(cmd));
}
let selected: std::collections::HashSet<u64> = self.tabs[i]
.scene
.selected_entities()
@@ -709,7 +716,7 @@ impl OpenCADStudio {
.document
.entities()
.filter(|e| {
(selected.is_empty() || selected.contains(&e.common().handle.value()))
selected.contains(&e.common().handle.value())
&& !self.tabs[i].scene.is_layer_locked(e.common().handle)
})
.map(|e| {
@@ -0,0 +1,6 @@
Tool {
command: "OVERKILL",
label: "Delete Duplicate Objects",
icon: include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/assets/icons/modify_overkill.svg")),
options: &[],
}