- 积分
- 2095
- 明经币
- 个
- 注册时间
- 2004-8-8
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
以下程序直接执行不可以,但如果在vbarun对话框选逐语句就可以运行.
开始时我想在对话框按下一个按纽,然后在图上选一个点,插入一个块,就用了sample的程序试了一下,结果对话框是焦点的情况下不能用utility的getpoint,只能在form1.hide之后才能utility.getpoint.后来发现,ThisDrawing.SendCommand 以后对话框还在,但不是焦点,可以用utility.getpoint,所以我想在getpoint前用一个空的指令,让对话框仍然显示在屏幕上,但不是焦点.
Private Sub CommandButton2_Click()
Dim returnPnt As Variant
ThisDrawing.SendCommand ("_open") 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"
returnPnt = ThisDrawing.Utility.GetPoint MsgBox "The WCS of the point is: " & returnPnt(0) & ", " & returnPnt(1) & ", " & returnPnt(2), , "GetPoint Example"
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)
Dim lineObj As AcadLine Set lineObj = ThisDrawing.ModelSpace.AddLine(basePnt, returnPnt) ZoomAll UserForm1.Show End Sub
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
x
|