怎么停止选择一个OBJECT?
我想选择一个物体后,对物体进行操作.用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 你想按最个键跳出? 我想按ESC键就退出. Case ***** '我想让用户按某个键后,就跳出,****该怎么写,好像都会执行见面的
'IF err<>0 部分.
EXIT SUB
改为:
Case Else
MsgBox
Exit Sub
就可以了。按ESC键就退出,选择不满足条件的也退出。 先看看置顶的贴子:
http://bbs.mjtd.com/forum.php?mod=viewthread&tid=5682
页:
[1]