- 积分
- 3266
- 明经币
- 个
- 注册时间
- 2002-7-5
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2003-5-14 08:41:00
|
显示全部楼层
例子:
本帖最后由 leeyeafu 于 2003-5-14 8:41:38 编辑
以下代码请注意适用的ACAD版本。
Sub Samp_color_2004()
Dim objLine As AcadLine
Dim Stpt(0 To 2) As Double
Dim Edpt(0 To 2) As Double
Dim str As String
Stpt(0) = 100: Stpt(1) = 10: Stpt(2) = 0
Edpt(0) = 150: Edpt(1) = 100: Edpt(2) = 0
Set objLine = ThisDrawing.ModelSpace.AddLine(Stpt, Edpt)
ZoomAll
Dim color As AcadAcCmColor
Set color = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
For i = 0 To 10
Call color.SetRGB(i * 100 Mod 255, ((i + 20) * 100) Mod 255, 255 - i * 20)
objLine.TrueColor = color
objLine.Update
str = ThisDrawing.Utility.GetString(False, "按任意键继续...")
Next i
End Sub
Sub Samp_color_2002()
Dim objLine As AcadLine
Dim Stpt(0 To 2) As Double
Dim Edpt(0 To 2) As Double
Dim str As String
Stpt(0) = 100: Stpt(1) = 10: Stpt(2) = 0
Edpt(0) = 150: Edpt(1) = 100: Edpt(2) = 0
Set objLine = ThisDrawing.ModelSpace.AddLine(Stpt, Edpt)
ZoomAll
For i = 1 To 25
objLine.color = i * 10 - 9
objLine.Update
str = ThisDrawing.Utility.GetString(False, "按任意键继续...")
Next i
End Sub |
|