- UID
- 3606
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-4-4
- 最后登录
- 1970-1-1
|
发表于 2002-5-15 03:42:54
|
显示全部楼层
例子:来自帮助
Sub Example_GetPoint()
' This example returns a point entered by the user.
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
End Sub |
|