tiger0101 发表于 2005-11-29 20:44:00

如何给一个实体赋任意颜色

Dim pLine as AcadLine
      pLine.color=0~256(颜色值)
      如果我要赋色如RGB(135,25,46),怎么实现

王咣生 发表于 2005-11-29 22:59:00

使用TrueColor属性:
Sub TrueColor_Test()
    ' This example draws a line and returns the RGB values
    Dim color As AcadAcCmColor
    Set color = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.16")
    Call color.SetRGB(80, 100, 244)
   
    Dim line As AcadLine
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
      
    startPoint(0) = 1#: startPoint(1) = 1#: startPoint(2) = 0#
    endPoint(0) = 5#: endPoint(1) = 5#: endPoint(2) = 0#
      
    Set line = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
    ZoomAll
   
    line.TrueColor = color
End Sub

tiger0101 发表于 2005-11-30 12:43:00

3ku
页: [1]
查看完整版本: 如何给一个实体赋任意颜色