角度の実数値(倍精度浮動小数点数型)を文字列値に変換します。
サポートされているプラットフォーム: Windows のみ
VBA:
RetVal = AngleToString(Angle, Unit, Precision)
タイプ: Utility
このメソッドが適用されるオブジェクト。
アクセス: 入力のみ
タイプ: 倍精度浮動小数点数型
角度の倍精度浮動小数点数値。
アクセス: 入力のみ
タイプ: acAngleUnits 列挙型
文字列の変換先の単位。
アクセス: 入力のみ
タイプ: 長整数型
角度の精度。0 から 8 までの整数。
タイプ: 文字列
角度の文字列値。
追加の注意はありません。
VBA:
Sub Example_AngleToString() ' This example converts a radian value to several different ' strings representing the value in different units. Dim angAsRad As Double Dim unit As Integer Dim precision As Long Dim angAsString As String angAsRad = 0.785398163397448 unit = acDegrees precision = 6 ' Convert the radian value to degrees with a precision of 6 angAsString = ThisDrawing.Utility.AngleToString(angAsRad, unit, precision) MsgBox "0.785398163397448 radians = " & angAsString & " degrees", , "AngleAsString Example" ' Convert the radian value to degrees/Minutes/Seconds with a precision of 6 unit = acDegreeMinuteSeconds angAsString = ThisDrawing.Utility.AngleToString(angAsRad, unit, precision) MsgBox "0.785398163397448 radians = " & angAsString, , "AngleAsString Example" ' Convert the radian value to grads with a precision of 6 unit = acGrads angAsString = ThisDrawing.Utility.AngleToString(angAsRad, unit, precision) MsgBox "0.785398163397448 radians = " & angAsString, , "AngleAsString Example" End Sub
Visual LISP:
(vl-load-com) (defun c:Example_AngleToString() ;; This example converts a radian value to several different ;; strings representing the value in different units. (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) (setq angAsRad 0.785398163397448 unit acDegrees precision 6) ;; Convert the radian value to degrees with a precision of 6 (setq angAsString (vla-AngleToString (vla-get-Utility doc) angAsRad unit precision)) (alert (strcat "0.785398163397448 radians = " angAsString)) ;; Convert the radian value to degrees/Minutes/Seconds with a precision of 6 (setq unit acDegreeMinuteSeconds) (setq angAsString (vla-AngleToString (vla-get-Utility doc) angAsRad unit precision)) (alert (strcat "0.785398163397448 radians = " angAsString)) ;; Convert the radian value to grads with a precision of 6 (setq unit acGrads) (setq angAsString (vla-AngleToString (vla-get-Utility doc) angAsRad unit precision)) (alert (strcat "0.785398163397448 radians = " angAsString)) )