.NET

Reply
Active Contributor
26 Posts
0 Kudos
Registered: ‎11-13-2006
Post 1 of 6

Xref Found At or Resolved Path

363 Views, 5 Replies
04-22-2009 09:46 AM
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.
Mentor
2,504 Posts
3 Kudos
Registered: ‎02-17-2004
Post 2 of 6

Re: Xref Found At or Resolved Path

04-24-2009 04:06 PM 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.
Active Contributor
26 Posts
0 Kudos
Registered: ‎11-13-2006
Post 3 of 6

Re: Xref Found At or Resolved Path

04-27-2009 01:18 PM 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
Mentor
2,504 Posts
3 Kudos
Registered: ‎02-17-2004
Post 4 of 6

Re: Xref Found At or Resolved Path

04-27-2009 01:21 PM 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.
Mentor
2,504 Posts
3 Kudos
Registered: ‎02-17-2004
Post 5 of 6

Re: Xref Found At or Resolved Path

04-27-2009 02:11 PM 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.
Active Contributor
46 Posts
0 Kudos
Registered: ‎10-29-2009
Post 6 of 6

Re: Xref Found At or Resolved Path

03-28-2013 02:02 PM 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...

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!