前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >VBA_CAD获取用户输入的坐标点

VBA_CAD获取用户输入的坐标点

作者头像
一线编程
发布2019-07-22 15:24:20
2.2K0
发布2019-07-22 15:24:20
举报
文章被收录于专栏:办公魔盒办公魔盒

Sub 获取用户输入的坐标点()

Dim startPnt As Variant

Dim endPnt As Variant

Dim prompt1 As String

Dim prompt2 As String

prompt1 = vbCrLf & "Enter the start point of the line: "

prompt2 = vbCrLf & "Enter the end point of the line: "

' 在不输入基点的情况下获取第一点

startPnt = ThisDrawing.Utility.GetPoint(, prompt1)

' 使用上面输入的点作为基点

endPnt = ThisDrawing.Utility.GetPoint(startPnt, prompt2)

' 使用输入的两个点创建一条直线

ThisDrawing.ModelSpace.AddLine startPnt, endPnt

ThisDrawing.Application.ZoomAll

End Sub

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2019-06-23,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 办公魔盒 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档