Relative Path not working in ArcMap and ArcObjects

1083
5
04-05-2012 12:10 PM
DavidStreet1
New Contributor
Hi,

I'm trying to set a relative paths for my MXD file. I have my MXD as c:\workspace\rastertest.mxd and the data is located at c:\workstation\data\testdted.dt2. When I set Relative Path to true in ArcMap or in ArcObjects using IMapDocument.SaveAs(true, true) the new raster data source will point to C:\Users\tester\AppData\Local\Temp\data. Do you know what could be causing this? I would like to eventually move around the MXD file and Rasters and keeping the same file hierarchy. I'm using ArcMap 10.0 and Windows 7 64 bit. Thank you.

Also, when I run ArcMap 10.0 on a Windows XP machine the relative paths work correctly.

David

PS I posted this question on ArcGIS Desktop forum. I didn't know which one would be more appropriate.
0 Kudos
5 Replies
DavidStreet1
New Contributor
Hi,

I'm trying to set a relative paths for my MXD file. I have my MXD as c:\workspace\rastertest.mxd and the data is located at c:\workstation\data\testdted.dt2. When I set Relative Path to true in ArcMap or in ArcObjects using IMapDocument.SaveAs(true, true) the new raster data source will point to C:\Users\tester\AppData\Local\Temp\data. Do you know what could be causing this? I would like to eventually move around the MXD file and Rasters and keeping the same file hierarchy. I'm using ArcMap 10.0 and Windows 7 64 bit. Thank you.

Also, when I run ArcMap 10.0 on a Windows XP machine the relative paths work correctly.

David

PS I posted this question on ArcGIS Desktop forum.   I didn't know which one would be more appropriate.
0 Kudos
NeilClemmons
Regular Contributor III
Is the XP machine 32 bit and are you using Visual Studio .NET?  If so, then check your target platform setting in Visual Studio to make sure it's set to x86 for all configurations.
0 Kudos
DavidStreet1
New Contributor
Is the XP machine 32 bit and are you using Visual Studio .NET?  If so, then check your target platform setting in Visual Studio to make sure it's set to x86 for all configurations.


Yes the XP machine is 32 bit and using Visual Studios 2008.   The Windows 7 machine is 64 bit but we are compiling in 32 bit.   The relative does not work either from ArcMap on the Windows 7 64 bit machine after we clicked on the relative path check box in the Map Document menu item.   Thanks.

David
0 Kudos
MLowry
by
Occasional Contributor II
David, do you have Xtools pro 8.0 installed? If so, you'll need to upgrade to 8.1 or un-install for Win7 to work nice with Esri relative paths.
0 Kudos
KerryAlley
Occasional Contributor
I am also having this problem.  My MXD is in my project's "root" folder, along with the 4 file geodatabases that it references.

The MXD is rather complex: 14 data frames, about 90 feature layers and table views, and numerous layout elements.  There are no references to data outside of the root folder, and no shapefiles.

After copying the entire project (the root folder) to a new location (e.g. "My Documents" on the C: drive), the paths all reflect the correct new location..... HOWEVER.....

If I disconnect from my work network (by disabling wireless) and open the MXD using a "borrowed" Advanced Desktop license, then the source paths for several (not all) data frames are broken.  I can't find a unique common trait among the data frames with broken layer sources.

Another observation:  If I reconnect the wireless and reopen the same MXD (without having saved it with the broken paths), the sources are fine.  If I stay working offline, the broken sources sources can all be fixed by manually reconnecting one layer to its datasource, BUT... if I save the "fixed" MXD, close it, and then open it again, the same sources are broken *again*.

Any idea what else might be befuddling the relative paths in this case?
0 Kudos