このメソッドは、指定したフィールドの一意の値のコレクションを返します。
宣言
public IEnumerable<IConvertible> Esri.ArcGISForAutoCAD.Attributes.UniqueValues(Document doc, string flName, string fieldName, string sublayerName = null)
パラメーター
| タイプ | 名前 | 説明 | 必須 |
|---|---|---|---|
ドキュメント | doc | 操作対象の AutoCAD ドキュメント。 | 必須 |
string | flName | ドローイング内の既存のフィーチャ レイヤー名。 | 必須 |
string | fieldName | フィーチャ レイヤーの既存のフィールド名。 | 必須 |
string | sublayerName | ドローイング内の既存のフィーチャ レイヤー サブレイヤー名。 | オプション |
リターン
| タイプ | 説明 |
|---|---|
IEnumerable<IConvertible> | 指定されたフィールド タイプと同じタイプの一意の値のコレクション。 |
エラー条件に関する注記
パラメーターが無効な場合、このメソッドは例外をスローするか、null を返すことがあります。
例
USA_States_Generalized (サブレイヤーなし) フィーチャ レイヤーの SUB_REGION フィールドから一意の値をリクエストします。// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;
// Gather the unique attribute values
var uniqueSubRegions = Esri.ArcGISForAutoCAD.Attributes.UniqueValues(doc, "USA_States_Generalized", "SUB_REGION");
// Print the unique attribute values
foreach (var uVal in uniqueSubRegions)
{
doc.Editor.WriteMessage("\n" + uVal);
}
/* Example output
Pacific
Mountain
West South Central
West North Central
East South Central
New England
South Atlantic
East North Central
Middle Atlantic
*/
次もご参照ください。
esri_attributes_uniquevalues - 指定したフィールドの一意の値のリストを返す AutoLISP 関数。