将下列程序拷贝到dvb中就可以将图层字符串到数组中。 Sub ll() Dim ConnectCad As New MyAcadEntity Dim tt As String ' With ConnectCad.objModelDocument With Thisdrawing Debug.Print "dim BaseLayerArray(" & .Layers.Count - 1 & ")" tt = "BaseLayerArray=array(" For ii = 0 To .Layers.Count - 2 tt = tt & Chr(34) & .Layers.Item(ii).Name & Chr(34) & "," Next ii tt = tt & Chr(34) & .Layers.Item(.Layers.Count - 1).Name & Chr(34) & ")" Debug.Print tt End With End Sub |