明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1148|回复: 0

[求助] 如何交互输入 2004

[复制链接]
发表于 2005-1-17 14:29:00 | 显示全部楼层 |阅读模式
vba 我把代码放到按钮里,执行时出现主窗口不存在 Dim returnPnt As Variant

' Return a point using a prompt
returnPnt = ThisDrawing.Utility.GetPoint(, "Enter a point: ")
MsgBox "The WCS of the point is: " & returnPnt(0) & ", " & returnPnt(1) & ", " & returnPnt(2) & vbCrLf & _
"(Enter the next value without prompting.)", , "GetPoint Example"

' Return a point, no prompt
returnPnt = ThisDrawing.Utility.GetPoint
MsgBox "The WCS of the point is: " & returnPnt(0) & ", " & returnPnt(1) & ", " & returnPnt(2), , "GetPoint Example"

' Return a point using a base point and a prompt
Dim basePnt(0 To 2) As Double
basePnt(0) = 2#: basePnt(1) = 2#: basePnt(2) = 0#
returnPnt = ThisDrawing.Utility.GetPoint(basePnt, "Enter a point: ")
MsgBox "The WCS of the point is: " & returnPnt(0) & ", " & returnPnt(1) & ", " & returnPnt(2)

' Create a line from the base point and the last point entered
Dim lineObj As AcadLine
Set lineObj = ThisDrawing.ModelSpace.AddLine(basePnt, returnPnt)
ZoomAll

评分

参与人数 1金钱 -5 贡献 -1 激情 -2 收起 理由
雪山飞狐_lzh -5 -1 -2 【差评】重复发贴

查看全部评分

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-27 21:05 , Processed in 0.156615 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表