BlockTableRecord.GetXrefDatabase Method
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
Please download the attachment, unpack it to some subdirectory and open the 1.dwg file.
I am trying to do the following thing: I want to programmatically open the above drawing, reload xrefs and view all files connected to it (dwg, pdf and jpg). This is not a problem. When browsing nested xrefs visible in 1.dwg I want to get handle of all nested xrefs BlockTableRecord, i.e. having open 1.dwg I would like to get handle 3.dwg and others. Also no problem. I took from the xrefs BlockTableRecord XrefDatabase.
However, there is a problem. Looking through the above XrefDatabase drawing 2.dwg I can get handle, but this handle is exactly the same as handle 3.dwg in 1.dwg. I want to take handle 3.dwg the same as in opened a 2.dwg file in autocad editor.
Why do I need it? Because I have an open one drawing 1.dwg for read, recursively iterate all nested references, recreate the structure of xrefs, open xrefs owner (for example 2.dwg) for write (Database.ReadDwgFile method) and direct modify 3.dwg xref path in the owner of the nested xref, (in 2.dwg). To open the 3.dwg xref I want use the BlockTableRecord handle.
Simplifying: I have open 1.dwg I see 3.dwg and I want his handle to be exactly like in 2.dwg and not in 1.dwg.
See ArxDbg tool and check the BlockTableRecord handle of the 3.dwg in two cases: When is open 1.dwg and is open 2.dwg.