Files
OneCAD-Draft/src/modules/insert/mod.rs
T
Hakan SevenandClaude Sonnet 4.6 64837e9aed feat: XREF management — auto-resolve, XATTACH, XREF, XRELOAD
- src/io/xref.rs: resolve_xrefs() scans block_records for is_xref flags,
  resolves paths relative to the opened file's directory, loads the
  referenced DWG/DXF and merges model-space entities into the xref block
- src/modules/insert/xattach.rs: XATTACH command with file-picker flow
  (XAttachPick/XAttachPickResult messages), prepare_xref_block() creates
  BlockRecord + Block entities and immediately resolves content
- XREF command: lists all external references in the drawing
- XRELOAD command: re-resolves all xref paths and rebuilds scene caches
- Auto-resolve on FileOpened: reports Loaded/NotFound per xref block
- CadCommand trait: added optional xattach_path() method
- ROADMAP.md: 1.9 XREF management marked ✅

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-08 00:02:38 +03:00

49 lines
1.2 KiB
Rust

// Insert module — file import, solid primitives, and blocks.
mod box_prim;
mod clear;
pub(crate) mod create_block;
mod cylinder;
pub(crate) mod insert_block;
mod open_obj;
mod sphere;
pub(crate) mod xattach;
use crate::modules::{CadModule, RibbonGroup};
pub struct InsertModule;
impl CadModule for InsertModule {
fn id(&self) -> &'static str {
"insert"
}
fn title(&self) -> &'static str {
"Insert"
}
fn ribbon_groups(&self) -> Vec<RibbonGroup> {
vec![
RibbonGroup {
title: "Import",
tools: vec![open_obj::tool().into(), clear::tool().into()],
},
RibbonGroup {
title: "Primitives",
tools: vec![
box_prim::tool().into(),
sphere::tool().into(),
cylinder::tool().into(),
],
},
RibbonGroup {
title: "Block",
tools: vec![
create_block::tool().into(),
insert_block::tool().into(),
xattach::tool().into(),
],
},
]
}
}