最初由 urljit 发布
[B]如果是vl里的变体alpt,如何利用polar函数呢?如下所示?可是不对呀,帮帮忙吧。
(setq al_pt(vlax-3d-point(polar (vlax-safearray->list al_pt) (* 1.5 pi) 70))) [/B] 
- (defun c:test (/ p p1 ac op)
- (if (setq p (getpoint "\nFirst Point: "))
- (progn
- (setq p1 (vla-polarpoint
- (vla-get-utility
- (setq ac
- (vla-get-activedocument (vlax-get-acad-object))
- )
- )
- (setq op (vlax-3d-point p))
- 0.
- 10.
- )
- )
- (vla-addline (vla-get-modelspace ac) op p1)
- )
- )
- (princ)
- )
PolarPoint
Gets the point at a specified angle and distance from a given point.
Signature
RetVal = PolarPoint(Point, Angle, Distance)
Object
Utility
The object or objects this method applies to.
Point
Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the start point.
Angle
Double; input-only
The angle in radians.
Distance
Double; input-only
The distance in current units.
RetVal
Variant (three-element array of doubles)
The 3D WCS coordinates at the specified angle and distance from a given point. |