A series of methods provided for utility purposes.
Utility functions that allow you to request input from the user or perform geometric calculations.
Gets the point selected in AutoCAD.
Dim pt As Variant
pt = ThisDrawing.Utility.getPoint(,"點選...")
pt = AcadApp.ActiveDocument.Utility.GetPoint(Type.Missing, "點選...");
Gets the angle of a line from the X axis.
Dim pt1 As Variant
pt1 = ThisDrawing.Utility.getPoint(,"點1")
Dim pt2 As Variant
pt2 = ThisDrawing.Utility.getPoint(,"點2")
retAngle = ThisDrawing.Utility.AngleFromXAxis(pt1, pt2)
Gets an object interactively.
Dim getObj As AcadObject
Dim pt As Variant
ThisDrawing.Utility.getEntity getObj, pt, "選取物件..."
getObj.Update
Converts an angle as a string to a real (double) value.
Dim angAsStr As String
Dim unit As Integer
angAsStr = "45"
unit = acDegrees
Dim Ang As Double
Ang = ThisDrawing.Utility.AngleToReal(angAsStr, unit)
Converts an angle from a real (double) value to a string.
Dim angAsRad As Double
Dim unit As Integer
Dim precision As Long
angAsRad = 0.785398163397448
unit = acDegrees
precision = 6
Dim angAsString As String
angAsString = ThisDrawing.Utility.AngleToString(angAsRad, unit, precision)
End Sub
Gets the point at a specified angle and distance from a given point.
Dim Pt As Variant
pt1 = ThisDrawing.Utility.getPoint(, "點選...")
'AngleToReal()
Dim angAsStr As String
Dim unit As Integer
angAsStr=30
unit = acDegrees
Dim Ang As Double
Ang = ThisDrawing.Utility.AngleToReal(angAsStr, unit)
Dim Dic As Double
Dic = 100
pt2 = ThisDrawing.Utility.getPoint.polarPoint(pt1, Ang, Dic)
Displays a prompt on the command line.
ThisDrawing.Utility.Prompt "提示文字"