Lighting Class — NXOpen Python API Reference 12.0.0 documentation

# Lighting Class

class `NXOpen.Display.``Lighting`

  Bases: `NXOpen.Builder`

  Represents a `NXOpen.Display.Lighting` Lights are used to illuminate the scene in Shaded and Studio rendering styles, as well as in High Quality Images.

  This class is restricted to being called from a program running during an Interactive NX session. If run from a non-interactive session it will return None.

  To create a new instance of this class, use `NXOpen.ViewCollection.CreateLighting()`

  New in version NX5.0.0.

# Properties

Property | Description
--- | ---
Tag | Returns the Tag for this object.

# Methods

Method | Description
--- | ---
Commit | Commits any edits that have been applied to the builder.
Destroy | Deletes the builder, and cleans up any objects created by the builder.
GetCommittedObjects | For builders that create more than one object, this method returns the objects that are created by commit.
GetLightBuilderFromList | Returns a light builder, given by the index, in the array of lights assigned to the work view
GetNumLightBuilders | Returns the total number of light builders in the given lighting list
GetObject | Returns the object currently being edited by this builder.
SetLightBuilderInList | Sets a light builder in the array at the given index
ShowResults | Updates the model to reflect the result of an edit to the model for all builders that support showing results.
Validate | Validate whether the inputs to the component are sufficient for commit to be called.

# Method Detail

## GetLightBuilderFromList

`Lighting.``GetLightBuilderFromList`

  Returns a light builder, given by the index, in the array of lights assigned to the work view

  Signature `GetLightBuilderFromList(index)`

  Parameters: | index (int) – index to the array of light builders
  Returns: | the light builder
  Return type: | `NXOpen.Display.LightBuilder`

  New in version NX5.0.0.

  License requirements: None.

## GetNumLightBuilders

`Lighting.``GetNumLightBuilders`

  Returns the total number of light builders in the given lighting list

  Signature `GetNumLightBuilders()`

  Returns: | total lights in the light builder array
  Return type: | int

  New in version NX5.0.0.

  License requirements: None.

## SetLightBuilderInList

`Lighting.``SetLightBuilderInList`

  Sets a light builder in the array at the given index

  Signature `SetLightBuilderInList(index, light)`

  Parameters:

  - index (int) – index to the array of light builders
  - light (`NXOpen.Display.LightBuilder`) – the light builder

  New in version NX5.0.0.

  License requirements: None.

## Validate

`Lighting.``Validate`

  Validate whether the inputs to the component are sufficient for commit to be called.

  If the component is not in a state to commit then an exception is thrown. For example, if the component requires you to set some property, this method will throw an exception if you haven’t set it. This method throws a not-yet-implemented NXException for some components.

  Signature `Validate()`

  Returns: | Was self validation successful
  Return type: | bool

  New in version NX3.0.1.

  License requirements: None.