|
Color Пример |
Sub Example_Color()
' Этот пример создает ломаную линию красного цвета.
' Затем показывает текущую установку цвета для ломаной линии.
Dim plineObj As AcadPolyline
Dim currentcolor As Variant
' Создайте Ломаную линию
Dim points(8) As Double
points(0) = 3: points(1) = 7: points(2) = 0
points(3) = 9: points(4) = 2: points(5) = 0
points(6) = 3: points(7) = 5: points(8) = 0
Set plineObj = ThisDrawing.ModelSpace.AddPolyline(points)
' Сначала установите цвет объекта Red
plineObj.Color = acRed
ThisDrawing.Regen (True)
' Теперь отыщите и покажите свойство Color
currentcolor = plineObj.Color
' Транслируйте цвет с числа в текст
If currentcolor = 256 Then
currentcolor = "By Layer"
Else
currentcolor = Choose(currentcolor + 1, "By Block", "Red", "Yellow", "Green", "Cyan", "Blue", "Magenta", "White")
End If
' Отображение
MsgBox "Цвет Ломаной линии: " & currentcolor, vbInformation, "Color Пример"
End Sub