Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

Ifeaturelayer to Ifeatureclass

$
0
0
Hi,

IMapDocument pmd = new MapDocumentClass();
if (pmd.get_IsMapDocument(@"F:/Projects/Inprogress.mxd"))
{
pmd.Open(@"F:/Projects/Inprogress.mxd", null);
IMap pmap = pmd as IMap;

pmap = pmd.get_Map(0);
Console.WriteLine(pmap.Name);//prints the Layer
ILayer PL = pmap.get_Layer(1);
Console.WriteLine(PL.Name);//prints the first layer
IFeatureLayer FL = PL as IFeatureLayer;
Console.WriteLine(FL.Name);//prints the first layer ofter typecasting to Feature Layer also
IFeatureClass FC = FL.FeatureClass; //after this I want to print the fields and rows.
There is not compiler error, it is showing FC||Null

How to move further..any help will be appreciated.

Thanks in advance

Viewing all articles
Browse latest Browse all 1374

Trending Articles