.NET
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
How to programmat ically find all references (xref dwg, jpg, pdf, OLE etc)?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I have some code (.Net addin application) that reads xrefs from a drawing. This code uses DataBase.GetHostDwgXrefGraph() and has worked fine until now.
However, now I've run into some drawings that references not only .dwg-files, but also .jpg-files.
In the XREF dialog in AutoCAD I can see that .jpg-files are referenced by the "parent" drawing, but GetHostDwgXrefGraph() doesn't seem to find the .jpg files.
I have attached some sample code to illustrate what I do (FindExternalReferences.cs). In that file, I have a CommandMethod "xrl" finds all references of the mdi document and writes to debug output in visual studio.
Also I added a zip-file containing a drawing "parent.dwg", and it referenes some other files that also are in the zip-file:
* Another .dwg - child.dwg
* sample-jpg.jpg
* OLE link - sample-word.docx
* PDF - sample-pdf.pdf
* WMF - sample-wmf.wmf
My top priority is to find referenced images (jpg, png, bmp), but I'd also be interested in how to find referenced OLE links, PDF and WMF.
Can I use GetHostDwgXrefGraph to accomplish this, or do I need to use some other method? Basically I'd like some code suggestion how I can find all referenced files from "parent.dwg" (not only the .dwg as my code works now).
Thanks in advance,
Mattias
Re: How to programmat ically find all references (xref dwg, jpg, pdf, OLE etc)?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010
http://www.acadxtabs.com
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");
Hi,
I have some code (.Net addin application) that reads xrefs from a drawing. This
code uses DataBase.GetHostDwgXrefGraph() and has worked fine until now.
However, now I've run into some drawings that references not only .dwg-files,
but also .jpg-files.
In the XREF dialog in AutoCAD I can see that .jpg-files are referenced by the
"parent" drawing, but GetHostDwgXrefGraph() doesn't seem to find the .jpg files.
I have attached some sample code to illustrate what I do
(FindExternalReferences.cs). In that file, I have a CommandMethod "xrl" finds
all references of the mdi document and writes to debug output in visual studio.
Also I added a zip-file containing a drawing "parent.dwg", and it referenes some
other files that also are in the zip-file:
* Another .dwg - child.dwg
* sample-jpg.jpg
* OLE link - sample-word.docx
* PDF - sample-pdf.pdf
* WMF - sample-wmf.wmf
My top priority is to find referenced images (jpg, png, bmp), but I'd also be
interested in how to find referenced OLE links, PDF and WMF.
Can I use GetHostDwgXrefGraph to accomplish this, or do I need to use some other
method? Basically I'd like some code suggestion how I can find all referenced
files from "parent.dwg" (not only the .dwg as my code works now).
Thanks in advance,
Mattias
Re: How to programmat ically find all references (xref dwg, jpg, pdf, OLE etc)?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
FileDependencyManager looks really interesting, however I found no documentation or samples on how to use it. By looking at FileDependencyManager in Visual Studio, it looks like it has methods for updating and erasing entries, but I found no way of enumerating all entries (???). Am I missing something obvious here? Do you have any suggestion on how to use the FileDependencyManager?
Thanks in advance,
Mattias
Re: How to programmat ically find all references (xref dwg, jpg, pdf, OLE etc)?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Have you found some examples somewhere (or do yo have some) and can you share them with me (us), I have the same requirements...
Thanx in advance
Re: How to programmat ically find all references (xref dwg, jpg, pdf, OLE etc)?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
Your code is good and it works fine..
But when I want to find only Direct Children then what to do?
Suppose I have a Drawing Structure like:
MasterRoot
Root1
MasterChild1
Child
MasterChild2
Child
Root2
MasterChild1
Child
MasterChild2
Child
When I use XrefGraph xg = mainDb.GetHostDwgXrefGraph(true); in Code then I get all the Files as a node including MasterRoot (say count=6).
If I want to get Only direct Children (here, Root1 and Root2)(means count=2 only), then wha i have to do?
Is it Possible?
Any help will be appreciated.
Thanks in Advance..
Thanks & Regards,
Vasant Padhiyar
Re: How to programmat ically find all references (xref dwg, jpg, pdf, OLE etc)?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
we meet same problem.
we can get the files attachment by Interop.TRANSMITTALLib.dll, but it's contain the pc3 and so on.
Who has the perfect solution?
Thanks!
Rick
Re: How to programmat ically find all references (xref dwg, jpg, pdf, OLE etc)?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
Please Go through the following link for the Solution:
Hope it helps..
Thanks,
Re: How to programmat ically find all references (xref dwg, jpg, pdf, OLE etc)?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Thanks, Vasant!
we can get all DWG reference file, but can't find the image(jpg/png/tiff)/PDF format file which attached my xref manager.
so your link's soluton can get the image file name/path?
Thanks!
Rick
Re: How to programmat ically find all references (xref dwg, jpg, pdf, OLE etc)?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Dear Vasant,
We tested the code in the new link(http://adndevblog.typepad.com/autocad/2012/06/find
Pls see the attachment of sample drawings with dwg/JPG xref files.
Thanks again!
Rick
Re: How to programmat ically find all references (xref dwg, jpg, pdf, OLE etc)?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content


