Community
Hi,
Please guide me In retrieving attached file details of drawing file
1. Attach DWG -- db.GetHostDwgXrefGraph(true);
2. Attach Image --
3. Attach DWF --
4. Arttach DGN --
5. Attach PDF --
Regards,
Raman
Solved! Go to Solution.
Solved by philippe.leefsma. Go to Solution.
You have to access the corresponding dictionary from the NOD and iterate through its content.
For example here is how to access the attached PDF dictionary and reload the pdfs:
[CommandMethod("PdfNetReload")] static public void PdfNetReload() { Document doc = Application.DocumentManager.MdiActiveDocument; Database db = doc.Database; Editor ed = doc.Editor; using (Transaction Tx = db.TransactionManager.StartTransaction()) { DBDictionary nod = Tx.GetObject(db.NamedObjectsDictionaryId, OpenMode.ForRead) as DBDictionary; string defDictKey = UnderlayDefinition.GetDictionaryKey(typeof(PdfDefinition)); if (!nod.Contains(defDictKey)) return; DBDictionary pdfDict = Tx.GetObject(nod.GetAt(defDictKey), OpenMode.ForWrite) as DBDictionary; foreach (DBDictionaryEntry entry in pdfDict) { PdfDefinition entryObj = Tx.GetObject(entry.Value, OpenMode.ForWrite) as PdfDefinition; entryObj.Load(null); ObjectIdCollection collection = entryObj.GetPersistentReactorIds(); foreach (ObjectId id in collection) { DBObject temObject = Tx.GetObject(id, OpenMode.ForRead); if (temObject is PdfReference) { PdfReference pdfref = temObject as PdfReference; pdfref.UpgradeOpen(); pdfref.RecordGraphicsModified(true); } } } Tx.Commit(); } }
Regards,
Philippe.
Can't find what you're looking for? Ask the community or share your knowledge.