Get all external files from DWG
Moderators: SDS, support, admin
Get all external files from DWG
In c#, using "CADImport .NET" we can get all xrefs from a dwg file.
But, how I get all other external files included in a DWG? All images, pdfs, etc?
Thanks in advance.
Code: Select all
CADEntityCollection xrefs = vCADFile.Converter.XRefs;
foreach (CADXRef rf in xrefs)
{
System.Diagnostics.Debug.WriteLine(" ***" + rf.Path);
}
Thanks in advance.
Re: Get all external files from DWG
Hello,jcs wrote: ↑28 Sep 2023, 17:42In c#, using "CADImport .NET" we can get all xrefs from a dwg file.
But, how I get all other external files included in a DWG? All images, pdfs, etc?Code: Select all
CADEntityCollection xrefs = vCADFile.Converter.XRefs; foreach (CADXRef rf in xrefs) { System.Diagnostics.Debug.WriteLine(" ***" + rf.Path); }
Thanks in advance.
I'm afraid I don't quite follow what external files in a DWG you mean. External references represent objects that exist outside a model file, but they are not files themselves. You can read more on XRefs in CAD .NET at
https://cadsofttools.ru/help/cadnet/ind ... ers--.html
If you want to get entities that are inside the XREF, you could do it using the CADEntity.Entities property.
Best regards,
Catherine
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: Get all external files from DWG
Hello,
I found the solution. With this code:
The project has images outside the dwg and can't work without them. With this code we can extract these files.
I found the solution. With this code:
Code: Select all
foreach (CADImageDef imdef in vCADFile.Converter.ImageDefs)
{
Debug.WriteLine(" *** IMAGE NAME: " + imdef.FileName);
}
Last edited by jcs on 29 Sep 2023, 16:54, edited 1 time in total.