DWF and DGN underlays: attach, display, snaps, frames and references

DWFATTACH / -DWFATTACH and DGNATTACH / -DGNATTACH attach a DWF / DWFx sheet
or a DGN (V7 or V8) model with the reference's prompts; ATTACH routes the
file types to them. The sheet or model is read into vector paths, drawn as a
transparent underlay raster (contrast, fade, monochrome and background
adjustment apply) and offers its geometry to object snaps. Definitions are
kept in ACAD_DWFDEFINITIONS / ACAD_DGNDEFINITIONS, the External References
palette lists and reloads them, and image textures get line-keeping mip
levels so thin underlay lines stay visible when zoomed out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
ramox81andClaude Opus 5.5 committed 2026-09-28 12:53:25 +03:00
1 parent 7f8f8457c7
commit cb7860e50e
46 files changed
+2723 -129

No files matched your search

+1 -5
View File
@@ -1121,7 +1121,6 @@ pub fn collect_entries_with_prev(
unloaded: &std::collections::HashSet<crate::io::xref_model::UnloadKey>,
prev: &std::collections::HashMap<u64, std::time::SystemTime>,
) -> Vec<crate::io::xref_model::ReferenceEntry> {
use codec::entities::UnderlayType;
use codec::objects::ObjectType;
use crate::io::xref_model::{
child_key, decide_status, normalize_lexical, RefKind, RefStatus, RefType,
@@ -1252,16 +1251,13 @@ pub fn collect_entries_with_prev(
let ObjectType::UnderlayDefinition(def) = obj else {
continue;
};
if def.underlay_type != UnderlayType::Pdf {
continue;
}
let key = handle.value();
let name = if def.name.trim().is_empty() {
file_name_only(&def.file_path).to_owned()
} else {
def.name.clone()
};
let mut entry = ReferenceEntry::new(key, name, RefKind::Pdf);
let mut entry = ReferenceEntry::new(key, name, RefKind::Underlay);
entry.saved_path = def.file_path.clone();
if def.unloaded || unloaded.contains(&UnloadKey::Direct(key)) {
entry.status = RefStatus::Unloaded;
+2 -1
View File
@@ -303,7 +303,8 @@ pub fn wildcard_match(name: &str, pattern: &str) -> bool {
pub enum RefKind {
DwgXref,
Image,
Pdf,
/// A PDF, DWF or DGN underlay.
Underlay,
}
/// Lifecycle state of a [`ReferenceEntry`].