折腾了半天,囫囵吞枣的拷贝到如下一点点咚咚,期待高人指点,这里面的xtype及xvalue的意思,为什么xtype多个值是1呢?如果我需要把axis及axis-text等图层都加进来又该如何设置xtype及xvalue呢?
-
-
- Dim xRec As AcadXRecord
- Dim oDict1 As AcadDictionary, oDict2 As AcadDictionary
- Dim xtype(0 To 6) As Integer
- Dim xvalue(0 To 6) As Variant
- Dim name As String
- name = "结构图层" 'Filter name
- xtype(0) = 1: xvalue(0) = name 'Filter Name:
- xtype(1) = 1: xvalue(1) = "AXIS" 'Layer Name
- xtype(2) = 1: xvalue(2) = "*" 'Color
- xtype(3) = 1: xvalue(3) = "*" 'Lineyype
- xtype(4) = 70: xvalue(4) = 0 'DXF (0 Both (On/Off) + 0 Both (Frz/Thaw) = 0)
- xtype(5) = 1: xvalue(5) = "*" 'Lineweight
- xtype(6) = 1: xvalue(6) = "*" 'PlotStyle
- 'xtype(7) = 1: xvalue(7) = "AXIS-TEXT" 'Layer Name
- Set oDict1 = acaddoc.Layers.GetExtensionDictionary
- Set oDict2 = oDict1.AddObject("ACAD_LAYERFILTERS", "AcDbDictionary")
- Set xRec = oDict2.AddXRecord(name)
- xRec.SetXRecordData xtype, xvalue
- acaddoc.Utility.Prompt xRec.Item(0).name
|