CompDrawingBuilder Class — NXOpen Python API Reference 12.0.0 documentation

# CompDrawingBuilder Class

class `NXOpen.Tooling.``CompDrawingBuilder`

  Bases: `NXOpen.Builder`

  Represents a `NXOpen.Tooling.CompDrawingBuilder` which is used to create or edit the Component Drawing.

  To create a new instance of this class, use `NXOpen.Tooling.ToolingDrawingCollection.CreateComponentDrawingBuilder()`

  Default values.

  Property | Value
  --- | ---
  ComponentType | All
  DrawingFilter | None
  Filter | Type
  IsKeepDrawingOpen | 0
  Margin | 15
  Projection | FirstAngleProjection

  New in version NX8.0.0.

# Properties

Property | Description
--- | ---
Component | Returns the component to create drawing.
ComponentType | Returns or sets the component type in mold or die project assembly.
DrawingFileNamingRule | Returns or sets the naming rule of drawing files.
DrawingFilter | Returns or sets the drawing component drawing filter.
DrawingSheetNamingRule | Returns or sets the naming rule of drawing sheets.
Filter | Returns or sets the filter to select component for drawing.
IsKeepDrawingOpen | Returns or sets the option whether to keep drawing open.
Margin | Returns or sets the margin for user defined drawing template.
MarginForView | Returns or sets the margin for view for user defined drawing template.
Projection | Returns or sets the drawing projection angle.
Tag | Returns the Tag for this object.
WizardType | Returns or sets the wizard type attribute

# Methods

Method | Description
--- | ---
AddCompSheet | Add a new sheet to a component.
Commit | Commits any edits that have been applied to the builder.
CreateAll | Creates all drawings.
CreateCompDrawing | Creates a drawing for a component
CreateComponentDrawingCopyAttribute | Creates a drawing for a component and copy attribute to the drawing part
CreateDrawing | Creates a drawing.
DeleteCompDrawing | Deletes drawings in self-contained part or deletes a master model part with drawings
DeleteCompSheet | Deletes a sheet from a component.
DeleteDrawing | Deletes a drawing.
Destroy | Deletes the builder, and cleans up any objects created by the builder.
EditCompDrawing | Edits a drawing in a component.
EditDrawing | Edits a drawing.
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.
InitConstructor | Initializes the component drawing value.
OpenCompDrawing | Opens a drawing in a component.
OpenDrawing | Opens a drawing.
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.

# Enumerations

CompDrawingBuilderComponentTypeSelection Enumeration | Specifies the type of components.
CompDrawingBuilderDrawingType Enumeration | Specifies the drawing type.
CompDrawingBuilderFilterSelection Enumeration | Specifies the filter of components.
CompDrawingBuilderProjectionType Enumeration | Specifies the project type.

# Property Detail

## Component

`CompDrawingBuilder.``Component`

  Returns the component to create drawing.

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

  Getter Method

  Signature `Component`

  Returns: |
  Return type: | `NXOpen.Assemblies.SelectComponent`

  New in version NX8.0.0.

  License requirements: None.

## ComponentType

`CompDrawingBuilder.``ComponentType`

  Returns or sets the component type in mold or die project assembly.

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

  Getter Method

  Signature `ComponentType`

  Returns: |
  Return type: | `NXOpen.Tooling.CompDrawingBuilderComponentTypeSelection`

  New in version NX8.0.0.

  License requirements: None.

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

  Setter Method

  Signature `ComponentType`

  Parameters: | componentType (`NXOpen.Tooling.CompDrawingBuilderComponentTypeSelection`) –

  New in version NX8.0.0.

  License requirements: ug_mold_design (“UG MOLD”) OR prog_die_wizard (“UG/Progressive Die Wizard”)

## DrawingFileNamingRule

`CompDrawingBuilder.``DrawingFileNamingRule`

  Returns or sets the naming rule of drawing files.

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

  Getter Method

  Signature `DrawingFileNamingRule`

  Returns: |
  Return type: | str

  New in version NX8.0.0.

  License requirements: None.

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

  Setter Method

  Signature `DrawingFileNamingRule`

  Parameters: | drawingFileNamingRule (str) –

  New in version NX8.0.0.

  License requirements: ug_mold_design (“UG MOLD”) OR prog_die_wizard (“UG/Progressive Die Wizard”)

## DrawingFilter

`CompDrawingBuilder.``DrawingFilter`

  Returns or sets the drawing component drawing filter.

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

  Getter Method

  Signature `DrawingFilter`

  Returns: |
  Return type: | `NXOpen.Tooling.CompDrawingBuilderDrawingType`

  New in version NX8.0.0.

  License requirements: None.

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

  Setter Method

  Signature `DrawingFilter`

  Parameters: | drawingType (`NXOpen.Tooling.CompDrawingBuilderDrawingType`) –

  New in version NX8.0.0.

  License requirements: ug_mold_design (“UG MOLD”) OR prog_die_wizard (“UG/Progressive Die Wizard”)

## DrawingSheetNamingRule

`CompDrawingBuilder.``DrawingSheetNamingRule`

  Returns or sets the naming rule of drawing sheets.

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

  Getter Method

  Signature `DrawingSheetNamingRule`

  Returns: |
  Return type: | str

  New in version NX8.0.0.

  License requirements: None.

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

  Setter Method

  Signature `DrawingSheetNamingRule`

  Parameters: | drawingSheetNamingRule (str) –

  New in version NX8.0.0.

  License requirements: ug_mold_design (“UG MOLD”) OR prog_die_wizard (“UG/Progressive Die Wizard”)

## Filter

`CompDrawingBuilder.``Filter`

  Returns or sets the filter to select component for drawing.

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

  Getter Method

  Signature `Filter`

  Returns: |
  Return type: | `NXOpen.Tooling.CompDrawingBuilderFilterSelection`

  New in version NX8.0.0.

  License requirements: None.

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

  Setter Method

  Signature `Filter`

  Parameters: | filter (`NXOpen.Tooling.CompDrawingBuilderFilterSelection`) –

  New in version NX8.0.0.

  License requirements: ug_mold_design (“UG MOLD”) OR prog_die_wizard (“UG/Progressive Die Wizard”)

## IsKeepDrawingOpen

`CompDrawingBuilder.``IsKeepDrawingOpen`

  Returns or sets the option whether to keep drawing open.

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

  Getter Method

  Signature `IsKeepDrawingOpen`

  Returns: |
  Return type: | bool

  New in version NX8.0.0.

  License requirements: None.

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

  Setter Method

  Signature `IsKeepDrawingOpen`

  Parameters: | isKeepDrawingOpen (bool) –

  New in version NX8.0.0.

  License requirements: ug_mold_design (“UG MOLD”) OR prog_die_wizard (“UG/Progressive Die Wizard”)

## Margin

`CompDrawingBuilder.``Margin`

  Returns or sets the margin for user defined drawing template.

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

  Getter Method

  Signature `Margin`

  Returns: |
  Return type: | int

  New in version NX8.0.0.

  License requirements: None.

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

  Setter Method

  Signature `Margin`

  Parameters: | margin (int) –

  New in version NX8.0.0.

  License requirements: ug_mold_design (“UG MOLD”) OR prog_die_wizard (“UG/Progressive Die Wizard”)

## MarginForView

`CompDrawingBuilder.``MarginForView`

  Returns or sets the margin for view for user defined drawing template.

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

  Getter Method

  Signature `MarginForView`

  Returns: |
  Return type: | float

  New in version NX8.5.0.

  License requirements: None.

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

  Setter Method

  Signature `MarginForView`

  Parameters: | marginForView (float) –

  New in version NX8.5.0.

  License requirements: ug_mold_design (“UG MOLD”) OR prog_die_wizard (“UG/Progressive Die Wizard”)

## Projection

`CompDrawingBuilder.``Projection`

  Returns or sets the drawing projection angle.

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

  Getter Method

  Signature `Projection`

  Returns: |
  Return type: | `NXOpen.Tooling.CompDrawingBuilderProjectionType`

  New in version NX8.0.0.

  License requirements: None.

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

  Setter Method

  Signature `Projection`

  Parameters: | projection (`NXOpen.Tooling.CompDrawingBuilderProjectionType`) –

  New in version NX8.0.0.

  License requirements: ug_mold_design (“UG MOLD”) OR prog_die_wizard (“UG/Progressive Die Wizard”)

## WizardType

`CompDrawingBuilder.``WizardType`

  Returns or sets the wizard type attribute

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

  Getter Method

  Signature `WizardType`

  Returns: |
  Return type: | int

  New in version NX8.5.0.

  License requirements: None.

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

  Setter Method

  Signature `WizardType`

  Parameters: | wizardType (int) –

  New in version NX8.5.0.

  License requirements: ug_mold_design (“UG MOLD”) OR prog_die_wizard (“UG/Progressive Die Wizard”)

# Method Detail

## AddCompSheet

`CompDrawingBuilder.``AddCompSheet`

  Add a new sheet to a component.

  Signature `AddCompSheet(component, componentPartName, drawingFileName, drawingName, templateName)`

  Parameters:

  - component (`NXOpen.NXObject`) –
  - componentPartName (str) – component part name
  - drawingFileName (str) – drawing file name
  - drawingName (str) – drawing name
  - templateName (str) – template name

  New in version NX8.5.0.

  License requirements: None.

## CreateAll

`CompDrawingBuilder.``CreateAll`

  Creates all drawings.

  Signature `CreateAll()`

  New in version NX8.0.0.

  License requirements: None.

## CreateCompDrawing

`CompDrawingBuilder.``CreateCompDrawing`

  Creates a drawing for a component

  Signature `CreateCompDrawing(component, componentPartName, drawingFileName, drawingName, templateName)`

  Parameters:

  - component (`NXOpen.NXObject`) –
  - componentPartName (str) – component part name
  - drawingFileName (str) – drawing file name
  - drawingName (str) – drawing name
  - templateName (str) – template name

  New in version NX8.5.0.

  Deprecated since version NX10.0.0: Use `NXOpen.Tooling.CompDrawingBuilder.CreateComponentDrawingCopyAttribute()` instead.

  License requirements: ug_mold_design (“UG MOLD”) OR prog_die_wizard (“UG/Progressive Die Wizard”)

## CreateComponentDrawingCopyAttribute

`CompDrawingBuilder.``CreateComponentDrawingCopyAttribute`

  Creates a drawing for a component and copy attribute to the drawing part

  Signature `CreateComponentDrawingCopyAttribute(component, componentPartName, drawingFileName, drawingName, templateName, attributeTitles, attributeValues)`

  Parameters:

  - component (`NXOpen.NXObject`) –
  - componentPartName (str) – component part name
  - drawingFileName (str) – drawing file name
  - drawingName (str) – drawing name
  - templateName (str) – template name
  - attributeTitles (list of str) – attribute titles
  - attributeValues (list of str) – attribute values

  New in version NX10.0.0.

  License requirements: ug_mold_design (“UG MOLD”) OR prog_die_wizard (“UG/Progressive Die Wizard”)

## CreateDrawing

`CompDrawingBuilder.``CreateDrawing`

  Creates a drawing.

  Signature `CreateDrawing(pName, dFile, dName, templateName)`

  Parameters:

  - pName (str) –
  - dFile (str) –
  - dName (str) –
  - templateName (str) –

  New in version NX8.0.0.

  Deprecated since version NX8.5.0: Use `NXOpen.Tooling.CompDrawingBuilder.CreateCompDrawing()` instead.

  License requirements: None.

## DeleteCompDrawing

`CompDrawingBuilder.``DeleteCompDrawing`

  Deletes drawings in self-contained part or deletes a master model part with drawings

  Signature `DeleteCompDrawing(component, componentPartName, drawingFileName, drawingName, templateName)`

  Parameters:

  - component (`NXOpen.NXObject`) –
  - componentPartName (str) – component part name
  - drawingFileName (str) – drawing file name
  - drawingName (str) – drawing name
  - templateName (str) – template name

  New in version NX8.5.0.

  License requirements: None.

## DeleteCompSheet

`CompDrawingBuilder.``DeleteCompSheet`

  Deletes a sheet from a component.

  Signature `DeleteCompSheet(component, componentPartName, drawingFileName, drawingName, templateName)`

  Parameters:

  - component (`NXOpen.NXObject`) –
  - componentPartName (str) – component part name
  - drawingFileName (str) – drawing file name
  - drawingName (str) – drawing name
  - templateName (str) – template name

  New in version NX8.5.0.

  License requirements: None.

## DeleteDrawing

`CompDrawingBuilder.``DeleteDrawing`

  Deletes a drawing.

  Signature `DeleteDrawing(pName, dFile, dName, templateName)`

  Parameters:

  - pName (str) –
  - dFile (str) –
  - dName (str) –
  - templateName (str) –

  New in version NX8.0.0.

  Deprecated since version NX8.5.0: Use `NXOpen.Tooling.CompDrawingBuilder.DeleteCompDrawing()` instead.

  License requirements: None.

## EditCompDrawing

`CompDrawingBuilder.``EditCompDrawing`

  Edits a drawing in a component.

  Signature `EditCompDrawing(component, componentPartName, drawingFileName, drawingName, templateName, oldSheetName)`

  Parameters:

  - component (`NXOpen.NXObject`) –
  - componentPartName (str) – component part name
  - drawingFileName (str) – drawing file name
  - drawingName (str) – drawing name
  - templateName (str) – template name
  - oldSheetName (str) – old sheet name

  New in version NX8.5.0.

  License requirements: None.

## EditDrawing

`CompDrawingBuilder.``EditDrawing`

  Edits a drawing.

  Signature `EditDrawing(pName, dFile, dName, templateName)`

  Parameters:

  - pName (str) –
  - dFile (str) –
  - dName (str) –
  - templateName (str) –

  New in version NX8.0.0.

  Deprecated since version NX8.5.0: Use `NXOpen.Tooling.CompDrawingBuilder.EditCompDrawing()` instead.

  License requirements: None.

## InitConstructor

`CompDrawingBuilder.``InitConstructor`

  Initializes the component drawing value.

  Signature `InitConstructor()`

  New in version NX8.0.0.

  License requirements: None.

## OpenCompDrawing

`CompDrawingBuilder.``OpenCompDrawing`

  Opens a drawing in a component.

  Signature `OpenCompDrawing(component, componentPartName, drawingFileName, drawingName, templateName)`

  Parameters:

  - component (`NXOpen.NXObject`) –
  - componentPartName (str) – component part name
  - drawingFileName (str) – drawing file name
  - drawingName (str) – drawing name
  - templateName (str) – template name

  New in version NX8.5.0.

  License requirements: None.

## OpenDrawing

`CompDrawingBuilder.``OpenDrawing`

  Opens a drawing.

  Signature `OpenDrawing(pName, dFile, dName, templateName)`

  Parameters:

  - pName (str) –
  - dFile (str) –
  - dName (str) –
  - templateName (str) –

  New in version NX8.0.0.

  Deprecated since version NX8.5.0: Use `NXOpen.Tooling.CompDrawingBuilder.OpenCompDrawing()` instead.

  License requirements: None.

## Validate

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