POST
|
Yes - I used that post. But still I wish there was an easier way to accomplish this . . . seams like basic functionality.
... View more
12-03-2013
07:59 AM
|
0
|
0
|
790
|
POST
|
thank you for your reply - much appreciated. My first error was that I was not using the Feature Class. ILayer2 pLayer; //Inside standard layer loop: pFLayer = pLayer as IFeatureLayer2; IDataset dataset = pFLayer.FeatureClass as IDataset; dataset.FullName.NameString; returns nothing (null) dataset.Workspace.PathName; returns the folder path dataset.Name; does now that I am using the FeatureClass return the file name with NO extension. dataset.BrowseName; returns the same as dataset.Name. then I am using: currentLExtention = pFLayer.DataSourceType.ToString(); if (currentLExtention.Contains("Shapefile")) currentLExtention = ".shp"; else currentLExtention = ""; to get the shape file extension. Interestingly for a raster data-set all I need is: IRasterLayer pRLayer = pLayer as IRasterLayer; currentLName = pRLayer.FilePath;//provides the file path AND the file name WITH the extension. Too bad it can't be this simple for a feature layer.
... View more
12-03-2013
05:58 AM
|
0
|
0
|
790
|
POST
|
Hi, I have been struggling for a long time now trying to replicate the functionality of the python code: lyr.dataSource where lyr is a layer in the map. This returns something like: \\Data\lakes.sdc\lakes for a GD \\Data\lakes.shp for a shapefile \\Data\lakes.jpg for a image etc. I have followed this example: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//004900000092000000 However the following code: Return (dataset.Workspace.PathName & "\" & dataset.Name) Does NOT return what I need. The .pathName returns the path which is fine but the .Name is the Layers DISPLAY name (what it is called in the map. It is NOT the name of the source file and does not include the file extension. So what object and property will return the source file name? Thanks, Vera
... View more
12-02-2013
09:01 AM
|
0
|
4
|
3849
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|