SketchPreferences Class — NXOpen Python API Reference 12.0.0 documentation

# SketchPreferences Class

class `NXOpen.Preferences.``SketchPreferences`

  Bases: `object`

  Represents the set of sketch preferences applicable on `NXOpen.Sketch` object

  To obtain an instance of this class, refer to `NXOpen.Sketch`

  New in version NX3.0.0.

# Properties

Property | Description
--- | ---
ConstraintSymbolSize | Returns or sets the constraint symbol size
ContinuousAutoDimensioningSetting | Returns or sets the setting that controls whether or not to continuously create auto dimensions in a sketch.
CreateInferredConstraints | Returns or sets the setting that controls whether or not inferred constraints are automatically created when curves and points are created in the sketch.
DimensionLabel | Returns or sets the dimension label.
DisplayObjectColor | Returns or sets the setting that controls whether or not objects are displayed in their actual color in sketch
DisplayObjectName | Returns or sets the setting that controls whether or not objects are displayed with their names in sketch.
DisplayParenthesesOnReferenceDimensions | Returns or sets the setting that controls whether or not parentheses are displayed on reference dimensions.
DisplayReferenceGeometry | Returns or sets the setting that controls whether or not the reference geometry are displayed on inactive sketches
DisplayVertices | Returns or sets the setting that controls whether or not vertices are displayed in an active sketch.
FixedTextSize | Returns or sets the fixed text size.
SolvingTolerance | Returns or sets the sketch solving tolerance.
TextSizeFixed | Returns or sets the setting that controls whether or not the dimension text size should be fixed.
UseSolvingTolerance | Returns or sets the setting that controls whether or not to use user input for sketch solving tolerance.

# Methods

Method | Description
--- | ---
ApplySketchPreferences | Applies sketch preferences set by user.

# Enumerations

SketchPreferencesDimensionLabelType Enumeration | Describes the different options for displaying dimension labels.

# Property Detail

## ConstraintSymbolSize

`SketchPreferences.``ConstraintSymbolSize`

  Returns or sets the constraint symbol size

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

  Getter Method

  Signature `ConstraintSymbolSize`

  Returns: |
  Return type: | float

  New in version NX8.5.0.

  License requirements: None.

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

  Setter Method

  Signature `ConstraintSymbolSize`

  Parameters: | constraintSize (float) –

  New in version NX8.5.0.

  License requirements: solid_modeling (“SOLIDS MODELING”) OR drafting (“DRAFTING”) OR geometric_tol (“GDT”)

## ContinuousAutoDimensioningSetting

`SketchPreferences.``ContinuousAutoDimensioningSetting`

  Returns or sets the setting that controls whether or not to continuously create auto dimensions in a sketch.

  If the option is true (On) then the auto dimensioner will be automatically executed after an individual curve is created in a sketch.

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

  Getter Method

  Signature `ContinuousAutoDimensioningSetting`

  Returns: |
  Return type: | bool

  New in version NX7.5.0.

  License requirements: None.

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

  Setter Method

  Signature `ContinuousAutoDimensioningSetting`

  Parameters: | autoDim (bool) –

  New in version NX7.5.0.

  License requirements: solid_modeling (“SOLIDS MODELING”) OR drafting (“DRAFTING”) OR geometric_tol (“GDT”)

## CreateInferredConstraints

`SketchPreferences.``CreateInferredConstraints`

  Returns or sets the setting that controls whether or not inferred constraints are automatically created when curves and points are created in the sketch.

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

  Getter Method

  Signature `CreateInferredConstraints`

  Returns: |
  Return type: | bool

  New in version NX6.0.0.

  License requirements: None.

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

  Setter Method

  Signature `CreateInferredConstraints`

  Parameters: | createInferredConstraints (bool) –

  New in version NX6.0.0.

  License requirements: solid_modeling (“SOLIDS MODELING”) OR drafting (“DRAFTING”) OR geometric_tol (“GDT”)

## DimensionLabel

`SketchPreferences.``DimensionLabel`

  Returns or sets the dimension label.

  Controls how expressions in sketch dimensions are displayed

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

  Getter Method

  Signature `DimensionLabel`

  Returns: |
  Return type: | `NXOpen.Preferences.SketchPreferencesDimensionLabelType`

  New in version NX3.0.0.

  License requirements: None.

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

  Setter Method

  Signature `DimensionLabel`

  Parameters: | dimensionLabel (`NXOpen.Preferences.SketchPreferencesDimensionLabelType`) –

  New in version NX3.0.0.

  License requirements: None.

## DisplayObjectColor

`SketchPreferences.``DisplayObjectColor`

  Returns or sets the setting that controls whether or not objects are displayed in their actual color in sketch

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

  Getter Method

  Signature `DisplayObjectColor`

  Returns: |
  Return type: | bool

  New in version NX4.0.0.

  License requirements: None.

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

  Setter Method

  Signature `DisplayObjectColor`

  Parameters: | displayObjectColor (bool) –

  New in version NX4.0.0.

  License requirements: solid_modeling (“SOLIDS MODELING”) OR drafting (“DRAFTING”) OR geometric_tol (“GDT”)

## DisplayObjectName

`SketchPreferences.``DisplayObjectName`

  Returns or sets the setting that controls whether or not objects are displayed with their names in sketch.

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

  Getter Method

  Signature `DisplayObjectName`

  Returns: |
  Return type: | bool

  New in version NX9.0.0.

  License requirements: None.

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

  Setter Method

  Signature `DisplayObjectName`

  Parameters: | displayObjectName (bool) –

  New in version NX9.0.0.

  License requirements: solid_modeling (“SOLIDS MODELING”) OR drafting (“DRAFTING”) OR geometric_tol (“GDT”)

## DisplayParenthesesOnReferenceDimensions

`SketchPreferences.``DisplayParenthesesOnReferenceDimensions`

  Returns or sets the setting that controls whether or not parentheses are displayed on reference dimensions.

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

  Getter Method

  Signature `DisplayParenthesesOnReferenceDimensions`

  Returns: |
  Return type: | bool

  New in version NX11.0.1.

  License requirements: None.

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

  Setter Method

  Signature `DisplayParenthesesOnReferenceDimensions`

  Parameters: | displayParentheses (bool) –

  New in version NX11.0.1.

  License requirements: solid_modeling (“SOLIDS MODELING”) OR drafting (“DRAFTING”) OR geometric_tol (“GDT”)

## DisplayReferenceGeometry

`SketchPreferences.``DisplayReferenceGeometry`

  Returns or sets the setting that controls whether or not the reference geometry are displayed on inactive sketches

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

  Getter Method

  Signature `DisplayReferenceGeometry`

  Returns: |
  Return type: | bool

  New in version NX11.0.1.

  License requirements: None.

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

  Setter Method

  Signature `DisplayReferenceGeometry`

  Parameters: | displayReferenceGeometry (bool) –

  New in version NX11.0.1.

  License requirements: solid_modeling (“SOLIDS MODELING”) OR drafting (“DRAFTING”) OR geometric_tol (“GDT”)

## DisplayVertices

`SketchPreferences.``DisplayVertices`

  Returns or sets the setting that controls whether or not vertices are displayed in an active sketch.

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

  Getter Method

  Signature `DisplayVertices`

  Returns: |
  Return type: | bool

  New in version NX11.0.0.

  License requirements: None.

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

  Setter Method

  Signature `DisplayVertices`

  Parameters: | displayVertices (bool) –

  New in version NX11.0.0.

  License requirements: solid_modeling (“SOLIDS MODELING”) OR drafting (“DRAFTING”) OR geometric_tol (“GDT”)

## FixedTextSize

`SketchPreferences.``FixedTextSize`

  Returns or sets the fixed text size.

  It is the visible dimension size when text size fixed is enabled.

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

  Getter Method

  Signature `FixedTextSize`

  Returns: |
  Return type: | float

  New in version NX6.0.0.

  License requirements: None.

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

  Setter Method

  Signature `FixedTextSize`

  Parameters: | fixedTextSize (float) –

  New in version NX6.0.0.

  License requirements: solid_modeling (“SOLIDS MODELING”) OR drafting (“DRAFTING”) OR geometric_tol (“GDT”)

## SolvingTolerance

`SketchPreferences.``SolvingTolerance`

  Returns or sets the sketch solving tolerance.

  This specifies the maximum allowable distance between two objects when solving the sketch constraints for the given sketch. The tolerance value must be greater than 1e-08.

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

  Getter Method

  Signature `SolvingTolerance`

  Returns: |
  Return type: | float

  New in version NX8.5.0.

  License requirements: None.

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

  Setter Method

  Signature `SolvingTolerance`

  Parameters: | tolerance (float) –

  New in version NX8.5.0.

  License requirements: solid_modeling (“SOLIDS MODELING”) OR drafting (“DRAFTING”) OR geometric_tol (“GDT”)

## TextSizeFixed

`SketchPreferences.``TextSizeFixed`

  Returns or sets the setting that controls whether or not the dimension text size should be fixed.

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

  Getter Method

  Signature `TextSizeFixed`

  Returns: |
  Return type: | bool

  New in version NX6.0.0.

  License requirements: None.

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

  Setter Method

  Signature `TextSizeFixed`

  Parameters: | textSizeFixed (bool) –

  New in version NX6.0.0.

  License requirements: solid_modeling (“SOLIDS MODELING”) OR drafting (“DRAFTING”) OR geometric_tol (“GDT”)

## UseSolvingTolerance

`SketchPreferences.``UseSolvingTolerance`

  Returns or sets the setting that controls whether or not to use user input for sketch solving tolerance.

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

  Getter Method

  Signature `UseSolvingTolerance`

  Returns: |
  Return type: | bool

  New in version NX8.5.0.

  License requirements: None.

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

  Setter Method

  Signature `UseSolvingTolerance`

  Parameters: | useTolerance (bool) –

  New in version NX8.5.0.

  License requirements: solid_modeling (“SOLIDS MODELING”) OR drafting (“DRAFTING”) OR geometric_tol (“GDT”)

# Method Detail

## ApplySketchPreferences

`SketchPreferences.``ApplySketchPreferences`

  Applies sketch preferences set by user.

  The dimDisplayFlag is the API version of the UI setting of Retain Dimensions which was last available for use in NX 6. The setting still exists in the UI for legacy parts that have a sketch with Retain Dimensions enabled. However, once the setting is turned off, it cannot be turned on again. This functionality is replaced by `NXOpen.Annotations.AnnotationManager.MakePmi()` in an active sketch or `NXOpen.Features.EditDimensionBuilder.DisplayAsPmi`()` when not in an active sketch.

  Signature `ApplySketchPreferences(dimDisplayFlag)`

  Parameters: | dimDisplayFlag (int) – If sketch dimensions are already displayed outside of an active sketch, Set 0 to turn off the display of dimensions outside of the active sketch.

  New in version NX3.0.0.

  License requirements: None.