DefineComponentBuilder Class — NXOpen Python API Reference 12.0.0 documentation

# DefineComponentBuilder Class

class `NXOpen.Layout2d.``DefineComponentBuilder`

  Bases: `NXOpen.Builder`

  Represents a Builder for Define 2D component functionality which will define * a 2D Component and stores its definition in the Reuse Library

  To create a new instance of this class, use `NXOpen.Layout2d.ComponentCollection.CreateDefineComponentBuilder()`

  Default values.

  Property | Value
  --- | ---
  ImageCapture.CaptureMethod | GraphicsArea
  ImageCapture.Format | Bmp
  ImageCapture.Size | Pixels64

  New in version NX10.0.0.

# Properties

Property | Description
--- | ---
AnchorPoint | Returns or sets the anchor point to define the 2D Component
ComponentName | Returns the 2D Component Name defines the name for the new created definition
Contents | Returns the select objects to create a 2D Component definition
ImageCapture | Returns the image capture builder used to create an image for the definition
ImageName | Returns or sets the 2D Component image name for the new created definition
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.
GetObject | Returns the object currently being edited by this builder.
SetLocation | Sets the location type of the component indicating local, native or team center
SetPath | Sets the path to store the 2D Component
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.

# Property Detail

## AnchorPoint

`DefineComponentBuilder.``AnchorPoint`

  Returns or sets the anchor point to define the 2D Component

  `-------------------------------------`

  Getter Method

  Signature `AnchorPoint`

  Returns: |
  Return type: | `NXOpen.Point`

  New in version NX10.0.0.

  License requirements: None.

  `-------------------------------------`

  Setter Method

  Signature `AnchorPoint`

  Parameters: | anchorPoint (`NXOpen.Point`) –

  New in version NX10.0.0.

  License requirements: nx_layout (“NX Layout”)

## ComponentName

`DefineComponentBuilder.``ComponentName`

  Returns the 2D Component Name defines the name for the new created definition

  `-------------------------------------`

  Getter Method

  Signature `ComponentName`

  Returns: |
  Return type: | `NXOpen.Layout2d.ComponentNameBuilder`

  New in version NX10.0.0.

  License requirements: None.

## Contents

`DefineComponentBuilder.``Contents`

  Returns the select objects to create a 2D Component definition

  `-------------------------------------`

  Getter Method

  Signature `Contents`

  Returns: |
  Return type: | `NXOpen.SelectNXObjectList`

  New in version NX10.0.0.

  License requirements: None.

## ImageCapture

`DefineComponentBuilder.``ImageCapture`

  Returns the image capture builder used to create an image for the definition

  `-------------------------------------`

  Getter Method

  Signature `ImageCapture`

  Returns: |
  Return type: | `NXOpen.Gateway.ImageCaptureBuilder`

  New in version NX10.0.0.

  License requirements: None.

## ImageName

`DefineComponentBuilder.``ImageName`

  Returns or sets the 2D Component image name for the new created definition

  `-------------------------------------`

  Getter Method

  Signature `ImageName`

  Returns: |
  Return type: | str

  New in version NX10.0.0.

  License requirements: None.

  `-------------------------------------`

  Setter Method

  Signature `ImageName`

  Parameters: | imageName (str) –

  New in version NX10.0.0.

  License requirements: nx_layout (“NX Layout”)

# Method Detail

## SetLocation

`DefineComponentBuilder.``SetLocation`

  Sets the location type of the component indicating local, native or team center

  Signature `SetLocation(locationType)`

  Parameters: | locationType (`NXOpen.Layout2d.Layout2dDefinitionLocation`) –

  New in version NX10.0.0.

  License requirements: nx_layout (“NX Layout”)

## SetPath

`DefineComponentBuilder.``SetPath`

  Sets the path to store the 2D Component

  Signature `SetPath(path)`

  Parameters: | path (str) – location of component

  New in version NX10.0.0.

  License requirements: nx_layout (“NX Layout”)

## Validate

`DefineComponentBuilder.``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.