获取矩形的一角。 支持的平台:仅窗口 签名工 务 局: RetVal = GetCorner(Point [, Prompt])
返回值(RetVal)类型:变体(双精度的三元素数组) 表示矩形拐角的 3D WCS 坐标。 言论AutoCAD 暂停用户输入矩形角,并将返回值设置为所选点的值。Point参数指定 3D WCS 坐标中矩形的基点;此参数是必需的。提示参数指定 AutoCAD 在暂停之前显示的字符串。提示是可选的。 AutoCAD 用户可以通过输入 WCS 坐标格式中的点来指定拐角;将“点”视为三维点。用户还可以通过在图形屏幕上指定位置来指定角。AutoCAD 绘制一个从“点”到当前十字准线位置的动态大小矩形,以帮助用户可视化第二个角的位置。矩形在 WCS 的XY平面中绘制。使用定点设备时,忽略点的 Z 字段,将结果的Z字段设置为当前高程。GetCornerGetCorner 例子工 务 局: Sub Example_GetCorner() ' This example provides a base point and prompts the user to ' input the second point to make a rectangle. AppActivate ThisDrawing.Application.Caption Dim returnPnt As Variant Dim basePnt(0 To 2) As Double basePnt(0) = 2#: basePnt(1) = 2#: basePnt(2) = 0# ' Prompt the user to pick second point and returns the point returnPnt = ThisDrawing.Utility.GetCorner(basePnt, "Enter Other corner: ") ' Display the point picked MsgBox "The point picked was " & returnPnt(0) & ", " & returnPnt(1) & ", " & returnPnt(2), , "GetCorner Example" End Sub Visual LISP: (vl-load-com) (defun c:Example_GetCorner() ;; This example provides a base point and prompts the user to ;; input the second point to make a rectangle. (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) ;; Prompt the user to pick second point and returns the point (setq basePnt (vlax-3d-point 2 2 0)) (setq returnPnt (vla-GetCorner (vla-get-Utility doc) basePnt "Enter Other corner: ")) ;; Display the point picked (setq returnPnt (vlax-safearray->list (vlax-variant-value returnPnt))) (alert (strcat "The point picked was " (rtos (nth 0 returnPnt) 2) ", " (rtos (nth 1 returnPnt) 2) ", " (rtos (nth 2 returnPnt) 2))) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:36
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.