.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FileDependencies

0 REPLIES 0
Reply
Message 1 of 1
shambles
233 Views, 0 Replies

FileDependencies

Hi

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
Next
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?

tia
merv
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost