![]() |
This document is archived and information here might be outdated. Recommended version. |
| ArcObjects Help for .NET developers > ESRI.ArcGIS.Snippets > Snippets > Get A Schematic Attribute On An In-Memory Schematic Feature Snippet (ArcObjects .NET 10.4 SDK) |
Retrieve a SchematicAttribute related to an in-memory schematic feature from its name
/// <summary>
/// Retrieve a SchematicAttribute related to an in-memory schematic feature from its name
/// </summary>
/// <param name="schemFeature">The ISchematicInMemoryFeature where the schematic attribute is defined</param>
/// <param name="AttributeName">The schematic attribute name</param>
/// <returns>The retrieved SchematicAttribute</returns>
public ESRI.ArcGIS.Schematic.ISchematicAttribute GetAttributeFromSchematicFeatureByName(ESRI.ArcGIS.Schematic.ISchematicInMemoryFeature schemFeature, string AttributeName)
{
// cast SchematicInMemoryFeature.SchematicElementClass into ISchematicAttributeContainer
ESRI.ArcGIS.Schematic.ISchematicAttributeContainer schAttribCont=(ESRI.ArcGIS.Schematic.ISchematicAttributeContainer)schemFeature.SchematicElementClass;
// the second parameter is set to True for recursive search
return schAttribCont.GetSchematicAttribute(AttributeName, true);
}
''' <summary>
''' Retrieve a SchematicAttribute related to an in-memory schematic feature from its name
''' </summary>
''' <param name="schemFeature">The ISchematicInMemoryFeature where the schematic attribute is defined</param>
''' <param name="AttributeName">The schematic attribute name</param>
''' <returns>The retrieved SchematicAttribute</returns>
Public Function GetAttributeFromSchematicFeatureByName(ByVal schemFeature As ESRI.ArcGIS.Schematic.ISchematicInMemoryFeature, ByVal AttributeName As String) As ESRI.ArcGIS.Schematic.ISchematicAttribute
' cast SchematicInMemoryFeature.SchematicElementClass into ISchematicAttributeContainer
Dim schAttribCont As ESRI.ArcGIS.Schematic.ISchematicAttributeContainer=TryCast(schemFeature.SchematicElementClass, ESRI.ArcGIS.Schematic.ISchematicAttributeContainer)
' the second parameter is set to True for recursive search
Return schAttribCont.GetSchematicAttribute(AttributeName, True)
End Function