将角度从实数(双精度)值转换为字符串。 支持的平台:仅窗口 签名工 务 局: RetVal = AngleToString(Angle, Unit, Precision)
返回值(RetVal)类型:字符串 作为字符串的角度。 言论没有额外的评论。 例子工 务 局: 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)) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:51
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.