Gets the angle specified. Considers the
setting of the ANGBASE system variable.
Signature
VLA : RetVal = Object.GetAngle([Point][, Prompt])
VL : RetVal = (vla-GetAngle Object
Point Prompt)
(vla-getangle util
nil "\nSelect Angle: ")
- Object Utility
The object or objects this method applies to.
- Point Variant (three-element array
of doubles); input-only; optional
The 3D WCS coordinates specifying the first point.
- Prompt Variant (string);
input-only; optional
The text used to prompt the user for input.
- RetVal Double
The angle specified.
Remarks
AutoCAD pauses for user input of an angle and sets the return value to
the value of the selected angle. The Point parameter specifies an angle
base point in the two-dimensional WCS. The Prompt parameter specifies a
string that AutoCAD displays before it pauses. Both Point and Prompt are
optional.
The AutoCAD user can specify the angle by entering a number in the
current angular units format. The user can set the angle also by
specifying two 2D locations on the graphics screen. AutoCAD draws a
rubber-band line from the first point to the current crosshair position
to help the user visualize the angle. If the Point parameter is
provided, AutoCAD uses this value as the first of the two points. The
angle is measured in the XY plane of the WCS (GetAngle ignores the Z
field of Point).
Regardless of the method used to specify the angle, GetAngle always sets
the return value to a value expressed in radians. The direction of
angular increase is always counterclockwise.
This function is almost identical to GetOrientation, but it takes into
account the current value of the ANGBASE system variable. For
GetOrientation, the zero angle is always to the right: "east"
or "three o'clock." For GetAngle, the zero angle is the value
of ANGBASE, which can be set to any of the four 90-degree quadrants.
Both GetAngle and GetOrientation return a (real) angle value in radians
measured counterclockwise from a base (zero) angle. For GetAngle, the
base equals ANGBASE; for GetOrientation, the base is at the right. Both
functions honor the current value of ANGDIR, which affects the value the
user enters but not the value that these functions return.
User
input (degrees) |
GetAngle
returns |
GetOrientation
returns |
0 |
0.0 |
1.5708 |
-90 |
1.5708 |
3.14159 |
180 |
3.14159 |
4.71239 |
90 |
4.71239 |
0.0 |
You can use GetAngle to obtain a
rotation amount for a block insertion, because an input of 0 degrees
always returns 0 radians. You can use GetOrientation to obtain the
baseline angle for a text entity to be aligned with other objects.
If a keyword is returned instead of an angle, AutoCAD will generate the
error message "User input keyword." Use the GetInput method to
obtain the keyword from the return value.
Example :
;get a reference to the Utilities Object :
(setq util (vla-get-utility
(vla-get-activedocument
(vlax-get-acad-object))))
(setq a (vla-getangle util nil "\nSelect Angle: "))
;Let's give it a base point :
(setq bpt (vla-getpoint util nil "/nSelect Base Point: "))
;And use it to "rubber band" :
(setq a (vla-getangle util bpt "\nSelect Angle: "))
|
|