- 积分
- 31755
- 明经币
- 个
- 注册时间
- 2005-5-16
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2012-11-15 22:35:47
|
显示全部楼层
本帖最后由 yshf 于 2012-11-15 22:45 编辑
- Option Explicit
- Dim oldLayer As AcadLayer
- Dim NewLayer As AcadLayer
- Private Sub AcadDocument_BeginCommand(ByVal CommandName As String)
- Debug.Print CommandName
- Select Case CommandName
- Case "DIMLINEAR", "DIMALIGNED", "DIMARC", "DIMORDINATE", "DIMRADIUS", "DIMJOGGED", "DIMDIAMETER", "DIMANGULAR", "QDIM", "DIMBASELINE", "DIMCONTINUE", "QLEADER"
- Set oldLayer = ThisDrawing.ActiveLayer
-
- On Error Resume Next
- Set NewLayer = ThisDrawing.Layers("DIM")
- If Err Then
- Err.Clear
- Set NewLayer = ThisDrawing.Layers.Add("DIM")
- End If
- ThisDrawing.ActiveLayer = ThisDrawing.Layers.Item("DIM")
- End Select
- End Sub
- Private Sub AcadDocument_EndCommand(ByVal CommandName As String)
- Select Case CommandName
- Case "DIMLINEAR", "DIMALIGNED", "DIMARC", "DIMORDINATE", "DIMRADIUS", "DIMJOGGED", "DIMDIAMETER", "DIMANGULAR", "QDIM", "DIMBASELINE", "DIMCONTINUE", "QLEADER"
- ThisDrawing.ActiveLayer = oldLayer
- End Select
- End Sub
|
|