我真的不想白费口舌,但是我觉得这个词让我很困惑。以下是其中一个模块代码1]
您的意思是对此进行更改?
- Option Explicit
- Public Enum CloseMode
- CloseMode_Close=???
- CloseMode_Cancel=&H1B ' Added here and I would reference CloseMode.CloseMode_Cancel ?
- End Enum
- Public Declare Function GetAsyncKeyState Lib "user32" _
- (ByVal vKey As Long) As Integer
- Public Function AddBKR()
- Dim dimsc As Integer
- dimsc = ThisDrawing.GetVariable("DIMSCALE")
- Dim InsPT As Variant
- Dim intOsMode As Integer
- Dim dblRotation As Double
- Dim objBlockRef As AcadBlockReference
- '************** Esc Code *************
- Dim varCancel As Variant
- On Error GoTo Err_Control
- '************** Esc Code *************
- Call LayerSet("3D-EQPM", acRed)
- intOsMode = ThisDrawing.GetVariable("OSMODE")
- ThisDrawing.SetVariable "OSMODE", 32
- InsPT = ThisDrawing.Utility.GetPoint(, "Pick Insertion Point: ")
- ThisDrawing.SetVariable "OSMODE", 512
- dblRotation = ThisDrawing.Utility.GetAngle(InsPT, "Pick Cabinet Side: ")
- Set objBlockRef = ThisDrawing.ModelSpace.InsertBlock(InsPT, Path & "breaker.dwg", 1, 1, 1, dblRotation)
- '************** Esc Code *************
- Exit_Here:
- LayerReSet
- ThisDrawing.SetVariable "OSMODE", intOsMode
- ThisDrawing.SetVariable "DIMSCALE", dimsc
- ThisDrawing.SetVariable "INSUNITS", 1
- Exit Function
- Err_Control:
- Select Case Err.Number
- Case -2147352567
- 'Debug.Print Err.Number, Err.Description
- varCancel = ThisDrawing.GetVariable("LASTPROMPT")
- If InStr(1, varCancel, "*Cancel*") 0 Then
- If GetAsyncKeyState(VK_ESCAPE) And 8000 > 0 Then
- Err.Clear
- Resume Exit_Here
- ElseIf GetAsyncKeyState(VK_LBUTTON) > 0 Then
- Err.Clear
- Resume
- End If
- Else
- If GetAsyncKeyState(VK_SPACE) Then
- Resume Exit_Here
- End If
- 'Missed the pick, send them back!
- Err.Clear
- Resume
- End If
- Case Else
- MsgBox Err.Description
- Resume Exit_Here
- End Select
- End Function
|