Active Member
Posts: 6
Registered: ‎02-23-2006
Message 1 of 1 (101 Views)


101 Views, 0 Replies
12-08-2006 09:38 AM

My environment is AutoCAD 2006 on WinXP SP2.

I'm tryin to use the FileDependencies object to get the path of various xrefs/images when these have been attached using 'no path'. However, I am encountering intermittent exceptions of the type 'The object has disconnected from its clients'.

My C# code is:

foreach(AcadFileDependency dep in Document.FileDependencies)
// Do stuff with file dependency object

The exception thrown is when the system attemtps to access the GetEnumerator method of FileDependencies during the foreach construct.

When the file is open I also tested it through the VBA editor using this code:

Sub test()
Dim fd
For Each fd In FileDependencies
Debug.Print fd.FileName
End Sub

This throws the "object disconnected" exception.

The strange thing is sometimes I can open the document and run it through VBA code no problem and it will also run through the C# code as well, but other times it seems to choke.

I've also tried accessing the file dependency list using an int indexer with the Item method, but this always fails with a "Key not found" exception.

This is driving me nuts. Does anybody have some ideas on what could be causing this?

Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.