CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

关于计算点和值 (VBA/ActiveX)

2023-1-5 02:13| 发布者: admin| 查看: 631| 评论: 0|来自: AutoCAD

摘要: 通过使用 Utility 对象提供的方法,可以快速求解数学问题或定位图形上的点。

通过使用对象提供的方法,您可以快速解决数学问题或定位图形上的点。Utility

通过在对象上使用方法,可以执行以下操作:Utility

  • 用方法从X轴找到一条线的角度AngleFromXAxis
  • 使用该方法将角度作为字符串转换为实数(双精度)值AngleToReal
  • 使用该方法将角度从实数(双精度)值转换为字符串AngleToString
  • 使用该方法将字符串的距离转换为实数(双精度)值DistanceToReal
  • 使用方法创建一个包含整数、浮点数、双精度数等数组的变体CreateTypedArray
  • 使用该方法查找与给定点保持指定角度和距离的点PolarPoint
  • 使用该方法将点从一个坐标系转换为另一个坐标系TranslateCoordinates
  • 用该方法查找用户输入的两个点之间的距离GetDistance

使用 GetDistance 方法查找两点之间的距离

此示例使用方法获取点坐标,并使用函数显示计算的距离。GetDistanceMsgBox

Sub Ch3_GetDistanceBetweenTwoPoints()
  Dim returnDist As Double

  ' Return the value entered by user. A prompt is provided.
  returnDist = ThisDrawing.Utility.GetDistance(, "Pick two points.")
  MsgBox "The distance between the two points is: " & returnDist
End Sub

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-12 00:10

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部