I have do admit that a lot needed APIs in Map's classification are missing.
It seems Feature Classification in AcadMap is just an interim stuff when
AcadMap incorporates Feature Data Object (FDO)/Feature Data Source (external
database), so that the Classification API does not change/emprove much after
4 new Map releases (from 2006 to 2009).
Anyway, for the seemingly easy task you want to do, it takes incredibly long
process (to write the code and to run) to achieve:
First, Call ClassificationManager.GetFeatureClassNames(), so that you obtain
a StringCollection of feature names;
Then, do this (pseudo-code):
string feature="Unknown";
foreach string featureName in featreNameCollection
{
ObjectIdCollection
entIds=ClassificationManager.GetClassifiedEntities(featureName, true/false)
foreach ObjectId id in entIds
{
If (id=MySelectedEnt.ObjectId)
{
//Finally, you find out what the entity is classified as
which feature.
feature=featureName;
break;
}
}
}
"El Haj" wrote in message news:5975643@discussion.autodesk.com...
Anyone can hel me, please?
I'd like to know how to determine the class of an ObjectId (already
classified from file). I select an object from the model space, and I want
to know the class of this entity:
entity = transaction.GetObject(Objectid, OpenMode.ForRead)
any help?