Resolve Lost References

Resolve Lost References

Anonymous
Not applicable
897 Views
6 Replies
Message 1 of 7

Resolve Lost References

Anonymous
Not applicable
Hello,



I want to automatically resolve lost references within an assembly. But, even if I use the ReplaceReference method and it does not fail, I still have the lost references.



Can you help me?
0 Likes
898 Views
6 Replies
Replies (6)
Message 2 of 7

jeff.pek
Community Manager
Community Manager
Hi -

Can you elaborate a little more on exactly what you're doing and seeing? When are you doing the ReplaceReference? How do you determine that the references are "still missing"?

Thanks,
Jeff
0 Likes
Message 3 of 7

Anonymous
Not applicable
Hi,



What I am trying to do is to update some lost references on files from content center. The Content Center folder was reviewed - moved folders, added files, etc and that resulted in lost references - a looot of lost references.



So, what am i trying to do is to replace old lost references with new references based on a input table. I go through all assembly files and when I find a lost reference I try to replace it with the new file:



if (docDescriptor.ReferenceMissing)

{

docDescriptor.ReferencedFileDescriptor.ReplaceReference(newFileName);

}



this does not fail, but if I look on docDescriptor.ReferenceMissing it is still true, even if the docDescriptor.FullDocumentName is set to the value of newFileName. Asfter the method finishes I have the same number of lost references.



As I read this could have something to do with ReplaceReference, as the help says: "The file being replaced and the replacement file must share ancestry (i.e. they
must have the same InternalName). Documents have the same internal name if they
are copied using ‘Save Copy As’ or a file explorer copy."
0 Likes
Message 4 of 7

Anonymous
Not applicable
Also, as I find it to be of importance, the Content Center folder is on a server .... it is just a shared folder, not using Autodesk Data Management System. Could this be a problem?
0 Likes
Message 5 of 7

Anonymous
Not applicable
I think that I found the problem. The files that I am trying to replace with are not seen as part of known locations.



So, it does not do the replacement properly.



As I see, only when you open an assembly you can specify in the Lost Reference window a reference that is in an unknown location. Can I do this through API?
0 Likes
Message 6 of 7

Anonymous
Not applicable

Since you're using this from within Inventor you
also have the option of using the ComponentOccurrence.Replace method.  If
the second argument is True then it will replace all occurrences that reference
the same document.  The Replace method doesn't have any restrictions about
the replacement document.  The primary reason for these restrictions is
that typically any downstream associativity will be lost if you replace it with
a completely new file, even if it is geometrically similar.  For example,
you'll likely lose assembly constraints and if drawings have been made,
dimensions and other things dependent on the geometry will be lost.
--

Brian Ekins
Autodesk Inventor API Product Designer

href="http://blogs.autodesk.com/modthemachine">http://blogs.autodesk.com/modthemachine
0 Likes
Message 7 of 7

Anonymous
Not applicable

The best solution is to add that location to your
project and then Inventor will find it.  It is possible through the API to
get an event whenever Inventor attempts to find a file and you can look for it
instead and provide the path.  However, the next time you open the
assembly, Inventor still won't find the files since it only looks in the
directories that are defined by the project.

size=2>
--
Brian Ekins
Autodesk Inventor API Product Designer

href="http://blogs.autodesk.com/modthemachine">http://blogs.autodesk.com/modthemachine
0 Likes