CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2024 开发者帮助

PolarPoint 方法 (ActiveX)

2024-5-18 19:07| 发布者: admin| 查看: 16| 评论: 0|原作者: admin|来自: AutoCAD

PolarPoint 方法 (ActiveX)

获取与给定点的指定角度和距离的点。

支持的平台:仅限 Windows

签名

VBA:

RetVal = object.PolarPoint(Point, Angle, Distance)
对象

类型: 实用程序

此方法应用到的对象。

访问:仅输入

类型:变体(双打的三元素阵列)

指定起点的 3D WCS 坐标。

角度

访问:仅输入

类型:

以弧度为单位的角度。

距离

访问:仅输入

类型:

以当前单位表示的距离。

返回值 (RetVal)

类型:变体(双打的三元素阵列)

3D WCS 与给定点的指定角度和距离坐标。

言论

没有其他评论。

例子

VBA:

Sub Example_PolarPoint()
    ' This example finds the coordinate of a point that is a given
    ' distance and angle from a base point.
    
    Dim polarPnt As Variant
    Dim basePnt(0 To 2) As Double
    Dim angle As Double
    Dim distance As Double
    
    basePnt(0) = 2#: basePnt(1) = 2#: basePnt(2) = 0#
    angle = 0.1744444   ' 45 degrees
    distance = 5
    polarPnt = ThisDrawing.Utility.PolarPoint(basePnt, angle, distance)
    
    ' Create a line from the base point to the polar point
    Dim lineObj As AcadLine
    Set lineObj = ThisDrawing.ModelSpace.AddLine(basePnt, polarPnt)
    ZoomAll
    
End Sub

可视化 LISP:

(vl-load-com)
(defun c:Example_PolarPoint()
    ;; This example finds the coordinate of a point that is a given
    ;; distance and angle from a base point.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    (setq basePnt (vlax-3d-point 2 2 0)
          ang 0.1744444   ;; 45 degrees
          dist 5)
    
    (setq polarPnt (vla-PolarPoint (vla-get-Utility doc) basePnt ang dist))
    
    ;; Create a line from the base point to the polar point
    (setq modelSpace (vla-get-ModelSpace doc))
    (setq lineObj (vla-AddLine modelSpace basePnt polarPnt))
    (vla-ZoomAll acadObj)
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-6-27 16:21

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部