List XReference

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
ywxu
Posts: 2
Joined: 05 Jul 2009, 12:52

List XReference

Post by ywxu » 07 Jul 2009, 16:35

How can I get a full list of the XReferences even some of them can't be loaded ?

support
Posts: 3272
Joined: 30 Mar 2005, 11:36
Contact:

Re: List XReference

Post by support » 13 Jul 2009, 16:48

Hello.
You can get the full list of XReferences using CADImage.Converter.XRefs property

Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

ywxu
Posts: 2
Joined: 05 Jul 2009, 12:52

Re: List XReference

Post by ywxu » 23 Jul 2009, 07:52

Thanks for your reply. I'm using following code to count the number of XREF:

Code: Select all

        Dim sFullName As String = "D:\Desktop\drawing1.dwg"
        Dim dwg As CADImage = CADImage.CreateImageByExtension(sFullName)
        dwg.LoadFromFile(sFullName)
        Dim n As Integer = dwg.Converter.XRefs.Count
The file "drawing1.dwg" actually has a xref "drawing2.dwg". If I place the xref "drawing2.dwg" in the path where can be located by "drawing1.dwg", then the above code shows me "1" - there is one xref. But if I place the xref in somewhere can't be located, then the above code shows me "0". The result I want the program to show me is there is one xref but it is missing. How can I get this result?

support
Posts: 3272
Joined: 30 Mar 2005, 11:36
Contact:

Re: List XReference

Post by support » 27 Jul 2009, 17:27

XRef object is a block that is loaded from a file by reference. In your example "drawing1.dwg" doesn't contain "drawing2.dwg" but only reference to it. When loading, if this reference not valid, XRef can't be loaded and ignored.

Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply