Table of Contents

Method SetColor

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Core.dll

SetColor(CadDocument, string, int)

Gives a layer a colour of AutoCAD's index, 1 to 255; a true colour it had is taken out, as AutoCAD's index colour does.

public static CadEditResult SetColor(CadDocument document, string name, int colorIndex)

Parameters

document CadDocument

The document.

name string

The layer's name.

colorIndex int

The index.

Returns

CadEditResult

What came of it.

SetColor(CadDocument, string, DxfColor)

Gives a layer a colour as AutoCAD's Select Color dialog does: one of the index, written to group 62 (below nought while the layer is off), or a true colour, written to group 420 with the index nearest it in 62, so that red, green and blue 10, 20, 30 is written 420 = 660510 beside the nearest index. ByLayer and ByBlock are refused, as a layer cannot take them, and a true colour in a file older than AutoCAD 2004 (AC1018), which has none.

public static CadEditResult SetColor(CadDocument document, string name, DxfColor color)

Parameters

document CadDocument

The document.

name string

The layer's name.

color DxfColor

The colour.

Returns

CadEditResult

What came of it.