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

Xref Found At or Resolved Path

5 REPLIES 5
Reply
Message 1 of 6
cbutler1
960 Views, 5 Replies

Xref Found At or Resolved Path

Using VB .NET we're trying to find the Resolved path of an Xref. We can get the Saved path (which, for us, is only the xref dwg name) but we need to determine where the Xref was "found at" by AutoCAD.

If someone can point us to the right object, it would be greatly appreciated.

Thanks in advance,

Craig.
5 REPLIES 5
Message 2 of 6
t.willey
in reply to: cbutler1

Check out the ' FindFile ' method. Here is how I called it in one of my routines.

HostApplicationServices.Current.FindFile(FilePath, db, FindFileHint.Default)

Where ' FilePath ' = path to search ( could be just a drawing name )
db = Database to search with reference to

I think there is a ' FindFileHint ' for Xref, but I'm not sure.
Message 3 of 6
cbutler1
in reply to: cbutler1

Thanks for the suggestion.

Findfile doesn't help if we're using the "Project Files Search Path" for locating Xrefs vs the "Support Files Search Path". Things start getting ugly. I was hoping that since the location information is available and known to AutoCAD there'd be a way to access it directly.

Craig
Message 4 of 6
t.willey
in reply to: cbutler1

Is there a FindFileHint for projects? I don't know, as I don't use projects. If not, then you could roll your own.
Message 5 of 6
t.willey
in reply to: cbutler1

Nevermind the first part of the previous reply. It makes no sense. Not sure what I was thinking.

I think you will have to roll your own find file if one doesn't exist with the project search path.
Message 6 of 6
harryliu3140
in reply to: cbutler1

I saw this thread when I have the problem. The solution is found out of this disscussion group:

 

        '-----------The key is db.ResolveXrefs, otherwise the Database of the Xref will be Nothing
db.ResolveXrefs(False, False) Dim XrGph As XrefGraph = db.GetHostDwgXrefGraph(True) For i As Integer = 1 To XrGph.NumNodes - 1 Dim XrGphNode As XrefGraphNode = XrGph.GetXrefNode(i) '------- the found path of the Xref is available now dim foundpath as string =XrGphNode.Database.Filename Next

 For anyone who has this problem...

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