qwh923820 发表于 2018-8-3 17:47:39

分享个找颜色代码

采用VB编程如果不引用CAD的库,那acred\cagreen等颜色符号就没法用,只能输入编号,以下简单的代码就能查看全部颜色。
Sub 找颜色()
Dim i&, x As Object
Dim p1(0 To 2) As Double, p2(0 To 2) As Double
For i = 0 To 256
    If i / 16 = i \ 16 Then
      p1(0) = p1(0) + 100: p1(1) = 0
    Else
      p1(1) = p1(1) + 70
    End If
Set x = ThisDrawing.ModelSpace.AddText(i, p1, 30)
    x.Color = i
Next i
End Sub

zzyong00 发表于 2018-8-5 14:21:30

有意思!

oistre 发表于 2018-8-8 13:16:45

下载试试,谢谢源码!
页: [1]
查看完整版本: 分享个找颜色代码