From fc04472472fb6b3c17313d4fcb4ccff866b0720b Mon Sep 17 00:00:00 2001 From: ramox81 <184937705+ramox81@users.noreply.github.com> Date: Fri, 16 Oct 2026 14:47:56 +0300 Subject: [PATCH] DGNIMPORT: a cell that draws nothing still becomes a block Co-Authored-By: Claude Opus 5.5 --- src/app/commands/dgn_import.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/app/commands/dgn_import.rs b/src/app/commands/dgn_import.rs index 0fe00693b..4344e4d59 100644 --- a/src/app/commands/dgn_import.rs +++ b/src/app/commands/dgn_import.rs @@ -715,7 +715,15 @@ fn place_converted( if scene.document.block_records.get(target).is_some() { continue; } - let entities = entities.into_iter().map(&fix).collect(); + let entities: Vec = entities.into_iter().map(&fix).collect(); + if entities.is_empty() { + // A cell that draws nothing still names a block. + let mut record = codec::tables::block_record::BlockRecord::new(target); + record.handle = scene.document.allocate_handle(); + let _ = scene.document.block_records.add(record); + crate::io::xref::ensure_block_entities(&mut scene.document, target); + continue; + } let _ = scene.define_block_from_owned_entities(entities, target, glam::DVec3::ZERO); } for entity in converted.entities {