ポイント注釈キーを使用する

ポイント注釈キーは、スタイル、ラベル スタイル、方向の情報が欠落しているテキスト ファイルから図面に読み込まれるポイント位置にそれらの情報をアタッチするための方法です。キーは、AeccPointDescriptionKey 型のオブジェクトです。AeccPointDescriptionKey.Name プロパティは、パターン マッチング コードです。 既存のキーの名前と一致する説明を持つ新しいポイントが作成された場合、そのポイントにはそのキーのすべての設定が割り当てられます。

名前には、ワイルドカードの「?」と「*」を使用できます。キーは、注釈文字列を通して渡すパラメータに応じて、ポイントの定数の尺度値または回転値を保持するか、または方向値を割り当てることができます。ポイント注釈キーは、AeccPointDescriptionKeySet 型のオブジェクトにセットとして保持されます。ドキュメント内のすべてのセットのコレクションは、ドキュメントの AeccDocument.PointDescriptionKeySets プロパティに保持されます。

' Create a key set in the document's collection
' of sets.
Dim oPointDescriptionKeySet As AeccPointDescriptionKeySet
Set oPointDescriptionKeySet = _
  oDocument.PointDescriptionKeySets.Add("Sample Key Set")
 
' Create a new key in the set we just made. Match with
' any description beginning with "SMP".
Dim oPointDescriptionKey As AeccPointDescriptionKey
Set oPointDescriptionKey = oPointDescriptionKeySet.Add("SAMP*")
 
' Assign chosen styles and label styles to the key.
oPointDescriptionKey.PointStyle = oPointStyle
oPointDescriptionKey.OverridePointStyle = True
oPointDescriptionKey.PointLabelStyle = oLabelStyle
oPointDescriptionKey.OverridePointLabelStyle = True
 
' Turn off the scale override, and instead scale
' to whatever is passed as the first parameter.
oPointDescriptionKey.OverrideScaleParameter = False
oPointDescriptionKey.UseDrawingScale = False
oPointDescriptionKey.ScaleParameter = 1
oPointDescriptionKey.ScaleXY = True
 
' And turn on the rotation override, and rotate
' all points using this key 45 degrees clockwise.
oPointDescriptionKey.OverrideFixedRotation = True
oPointDescriptionKey.FixedRotation = 0.785398163 ' radians
oPointDescriptionKey.ClockwiseRotation = True

次に、「PENZD (comma delimited)」形式のテキスト ファイルの内容とポイント情報、説明、およびパラメータを示します。これによって、定義済みの SAMP* 注釈キーを使用して 2 つのポイントが作成され、ポイント マーカーが通常サイズの 4 倍になります。

2000,3700.0,4900.0,150.0,SAMPLE 4
2001,3750.0,4950.0,150.0,SAMPLE 4

Points.ImportPoints を使用してテキスト ファイルがロードされると、ポイントの説明に含まれる最初の英数字要素とすべてのポイント注釈キーの名前が比較されます。 一致が発見された場合、ポイントの設定がその注釈キーに合わせて調整されます。注釈キーに渡されるすべてのパラメータは、スペースで区切って説明の後に追加します。パラメータを使用する場合、カンマ区切り形式のファイルを使用しないと、パラメータは無視されます。このプロセスは、ポイントがファイルから読み込まれるときにだけ実行されます。ポイントの作成後は、AeccPoint.RawDescription プロパティを設定してもポイントのスタイルは変更されません。