ObjectColorSource

Returns or modifies the color source of an object.   The color used to display objects is specified in one of four ways:

  1. Color from layer.  The object's layer determines the object's color.

  2. Color from object.  The object's color is set by the object itself.

  3. Color from material.  The object's diffuse material color determines the object's color.

  4. Color from parent. For objects with parents, like objects in block instances, use parent's color source. If no parent, treats as color from layer.

Syntax

rhinoscriptsyntax.ObjectColorSource(object_ids, source=None)

rhinoscript.object.ObjectColorSource(object_ids, source=None)

Parameters

object_ids

Required.  String, Guid, or List of Guids.  The identifier(s) of the object(s).

source

Optional.  Number.  The new color source.  If omitted, the current color source is returned.  Note, if objects_ids is a list, source is required.

Value

Description

0

Color from layer

1

Color from object

2

Color from material

3

Color from parent

Returns

Number

If a color source is not specified,  the current color source if successful.

Number

If a color source is specified, the previous color source if successful.

Number

If object_ids is a list, then the number of objects modified if successful.

Example

import rhinoscriptsyntax as rs

objs = rs.GetObjects("Select objects to reset color source")

if objs:

    for obj In objs: rs.ObjectColorSource(obj, 0)

Also See

ObjectColor