看着图层管理器,因为你使用线命令,转义yadayada
- Option Explicit
- Private Curlayer As AcadLayer
- Private bActive As Boolean
- Private Sub AcadDocument_BeginCommand(ByVal CommandName As String)
- If bActive Then
- ThisDrawing.ActiveLayer = Curlayer
- End If
-
- If CommandName = "LINE" Then
- Set Curlayer = ThisDrawing.ActiveLayer
- ThisDrawing.ActiveLayer = ThisDrawing.Layers("0")
- bActive = True
- End If
- End Sub
- Private Sub AcadDocument_EndCommand(ByVal CommandName As String)
- If CommandName = "LINE" Then
- bActive = False
- ThisDrawing.ActiveLayer = Curlayer
- End If
- End Sub
|