概要 - 点と値を計算する(VBA/ActiveX)

Utility オブジェクトのメソッドを使用すると、数学的問題をすばやく解決したり、図面上の点を検出することができます。

Utility オブジェクトのメソッドを使用して、次のような操作ができます。

GetDistance メソッドを使用して、2 点間の距離を検出する

次の例は、GetDistance メソッドを使用して点の座標を取得し、MsgBox 関数を使用して算出した距離を表示しています。

Sub Ch3_GetDistanceBetweenTwoPoints()
  Dim returnDist As Double

  ' Return the value entered by user. A prompt is provided.
  returnDist = ThisDrawing.Utility.GetDistance(, "Pick two points.")
  MsgBox "The distance between the two points is: " & returnDist
End Sub