- 积分
- 476
- 明经币
- 个
- 注册时间
- 2003-8-16
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
我想选择一个物体后,对物体进行操作.用GOTO语句循环,程序如下:
Sub GetEntity_Example()
Dim retEnt As Object
Dim pnt As Variant
On Error Resume Next
Retry:
ThisDrawing.Utility.GetEntity retEnt, pnt, "Select an object"
If Err <> 0 Then '如果按其他键或者不选择物体
Err.Clear
MsgBox "You need to select an existing dimension!"
Else
Select Case retEnt.EntityName
Case "AcDbAlignedDimension"
InputGYXX '调用子程序
Case "AcDbRotatedDimension"
InputGYXX
Case "AcDbRadialDimension"
InputGYXX
Case "AcDbDiametricDimension"
InputGYXX
Case "AcDbOrdinateDimension"
InputGYXX
Case "AcDbMText"
InputGYXX
Case "AcDbText"
InputGYXX
Case "AcDb2LineAugularDimension"
InputGYXX
Case ***** '我想让用户按某个键后,就跳出,****该怎么写,好像都会执行见面的
'IF err<>0 部分.
EXIT SUB
End Select
End If
GOTO Retry
End Sub |
|