CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

极点法 (ActiveX)

2023-1-4 05:02| 发布者: admin| 查看: 603| 评论: 0|来自: AutoCAD

摘要: 获取与给定点保持指定角度和距离的点。

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

支持的平台:仅窗口

签名

工 务 局:

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

类型:实用工具

此方法适用的对象。

访问:仅输入

类型:变体(双精度的三元素数组)

指定起点的 3D WCS 坐标。

角度

访问:仅输入

类型:

以弧度为单位的角度。

距离

访问:仅输入

类型:

以当前单位表示的距离。

返回值(RetVal)

类型:变体(双精度的三元素数组)

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

言论

没有额外的评论。

例子

工 务 局:

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

Visual 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-5-12 11:23

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部