forked from 1b-agent/opencadstudio-upstream
Merge pull request #1175 from Ramox81
This commit is contained in:
commit
90af02664d
3 files changed
+16
-2
No files matched your search
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#B4B6B9" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M3 4h12v12H3ZM8 9h12v12H8Z"/><path stroke="#6DB7ED" d="m16 2 6 6m0-6-6 6"/></svg>
|
||||||
|
After Width: | Height: | Size: 246 B |
@@ -692,10 +692,17 @@ impl OpenCADStudio {
|
|||||||
// ── OVERKILL — delete duplicate (identical) objects ──────────
|
// ── OVERKILL — delete duplicate (identical) objects ──────────
|
||||||
// Removes objects that are identical in geometry AND properties to
|
// Removes objects that are identical in geometry AND properties to
|
||||||
// another object (compared with the handle ignored). Operates on
|
// 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.
|
// selected. Conservative: only exact duplicates are removed.
|
||||||
"OVERKILL" => {
|
"OVERKILL" => {
|
||||||
use acadrust::Handle;
|
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]
|
let selected: std::collections::HashSet<u64> = self.tabs[i]
|
||||||
.scene
|
.scene
|
||||||
.selected_entities()
|
.selected_entities()
|
||||||
@@ -709,7 +716,7 @@ impl OpenCADStudio {
|
|||||||
.document
|
.document
|
||||||
.entities()
|
.entities()
|
||||||
.filter(|e| {
|
.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)
|
&& !self.tabs[i].scene.is_layer_locked(e.common().handle)
|
||||||
})
|
})
|
||||||
.map(|e| {
|
.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: &[],
|
||||||
|
}
|
||||||
Reference in new issue
Block a user