UserDefinedObjectDisplayContext Class¶
-
class
NXOpen.UserDefinedObjects.
UserDefinedObjectDisplayContext
¶ Bases:
NXOpen.TransientObject
This class is used to display User Defined Objects
New in version NX5.0.0.
Methods¶
Method | Description |
---|---|
DisplayAbsoluteRotationScreenSizeStandardText | Displays a single line Standard Text string using Absolute Rotation and Screen Size Geometry for a UserDefinedObject . |
DisplayAbsoluteStandardText | Displays a single line Standard Text string using Absolute Geometry for a UserDefinedObject . |
DisplayArc | Displays an arc for a UserDefinedObject . |
DisplayCircle | Displays a circle for a UserDefinedObject . |
DisplayFacets | Displays a series of facets for a UserDefinedObject . |
DisplayMultiLineAbsoluteRotationScreenSizeStandardText | Displays a multi-line Standard Text string using Absolute Rotation and Screen Size Geometry for a UserDefinedObject . |
DisplayMultiLineAbsoluteStandardText | Displays a multi-line Standard Text string using Absolute Geometry for a UserDefinedObject . |
DisplayMultiLineScreenStandardText | Displays a multi-line Standard Text string using Screen Geometry for a UserDefinedObject . |
DisplayPoints | Displays a series of points for a UserDefinedObject . |
DisplayPolygon | Displays a polygon (a closed set of line segements) for a UserDefinedObject . |
DisplayPolyline | Displays a polyline (a connected set of line segements) for a UserDefinedObject . |
DisplayScreenStandardText | Displays a single line Standard Text string using Screen Geometry for a UserDefinedObject . |
DisplayText | Displays a text string using an NX text font for a UserDefinedObject . |
DisplayUnicodeMarker | Displays a single character in the given font and style centered at the given position. |
Dispose | Frees the memory associated with this object. |
GetViewMode | Get information about the current view mode and display context in which geometry is displayed. |
Enumerations¶
UserDefinedObjectDisplayContextFacetType Enumeration | The enumerated type facet to be displayed |
UserDefinedObjectDisplayContextPolyMarker Enumeration | This enumerated type specifies the type of marker to be displayed. |
UserDefinedObjectDisplayContextStandardTextRef Enumeration | This enumerated type specifies the type of reference point used in the text box for standard_text methods. |
UserDefinedObjectDisplayContextTextRef Enumeration | This enumerated type specifies the type of reference point used in the text box. |
UserDefinedObjectDisplayContextTextSize Enumeration | Provides a way to specify the size of the desired text, as small, medium or large (normal is a synonym for medium). |
UserDefinedObjectDisplayContextViewMode Enumeration | The enumerated view mode |
Method Detail¶
DisplayAbsoluteRotationScreenSizeStandardText¶
-
UserDefinedObjectDisplayContext.
DisplayAbsoluteRotationScreenSizeStandardText
¶ Displays a single line “Standard Text” string using “Absolute Rotation and Screen Size Geometry” for a
UserDefinedObject
. A “Standard Text” string uses one of the fonts available from the operating system. “Absolute Rotation and Screen Size Geometry” means the text appears the same physical sized on the screen regardless of the view scale (like “Screen Geometry”), the text remains front-facing and approximately upright (similar to “Screen Geometry”), but the orientation of the text changes as the user rotates the view (like “Absolute Geometry”). The text will be displayed on the XY plane of the absolute coordinate system. This method is not supported for 2D output such as CGM.Signature
DisplayAbsoluteRotationScreenSizeStandardText(fontIndex, fontStyle, textCoordinates, referencePointType, string, textSize)
Parameters: fontIndex – Index of the text font to be used. This must be an index of a standard font. It may be 0 to use the default font. :type fontIndex: int :param fontStyle: The name of a style supported by the given font. Specify NULL to use the default style for the font, which usually is Regular (no bold, no italic). If a non-NULL style does not exist for the font, the font’s default style will be used. :type fontStyle: str :param textCoordinates: Position of text box reference point in Absolute Coordinates :type textCoordinates:
NXOpen.Point3d
:param referencePointType: Reference point type of text box :type referencePointType:NXOpen.UserDefinedObjects.UserDefinedObjectDisplayContextStandardTextRef
:param string: Text string to display :type string: str :param textSize: see enum values :type textSize:NXOpen.UserDefinedObjects.UserDefinedObjectDisplayContextTextSize
New in version NX8.0.0.
License requirements: None.
DisplayAbsoluteStandardText¶
-
UserDefinedObjectDisplayContext.
DisplayAbsoluteStandardText
¶ Displays a single line “Standard Text” string using “Absolute Geometry” for a
UserDefinedObject
. A “Standard Text” string uses one of the fonts available from the operating system. “Absolute Geometry” means that the text scales and rotates with the view, so it appears larger when you zoom in and smaller when you zoom out. This is the type of text normally used by NX Drafting. Note that the text will be displayed on the Absolute XY plane.Signature
DisplayAbsoluteStandardText(fontIndex, fontStyle, textCoordinates, referencePointType, string, glyphWidth, glyphHeight)
Parameters: fontIndex – Index of the text font to be used. This must be an index of a standard font. It may be 0 to use the default font. :type fontIndex: int :param fontStyle: The name of a style supported by the given font. Specify NULL to use the default style for the font, which usually is Regular (no bold, no italic). If a non-NULL style does not exist for the font, the font’s default style will be used. :type fontStyle: str :param textCoordinates: Position of text box reference point in Absolute Coordinates :type textCoordinates:
NXOpen.Point3d
:param referencePointType: Reference point type of text box :type referencePointType:NXOpen.UserDefinedObjects.UserDefinedObjectDisplayContextStandardTextRef
:param string: Text string to display :type string: str :param glyphWidth: Width of text in units of the Displayed Part :type glyphWidth: float :param glyphHeight: Height of text in units of the Displayed Part :type glyphHeight: floatNew in version NX8.0.0.
License requirements: None.
DisplayArc¶
-
UserDefinedObjectDisplayContext.
DisplayArc
¶ Displays an arc for a
UserDefinedObject
. The arc will be created in a plane whose normal is the Z axis of the orientation matrix (matrix[0-2] is the X axis of the orientation matrix, matrix[3-5] is the Y axis of the orientation matrix, and matrix[6-8] is the Z axis of the orientation matrix.) The start and end angles are measured relative to the X and Y axis of this orientation matrix.Signature
DisplayArc(center, original, radius, startAngle, endAngle)
Parameters: - center (
NXOpen.Point3d
) – Center of the arc (absolute coordinates transformed by the orientation matrix) - original (
NXOpen.Matrix3x3
) – Orientation matrix for the arc. - radius (float) – Radius of the arc. Must be greater than zero.
- startAngle (float) – Start angle in radians
- endAngle (float) – End angle in radians
New in version NX5.0.0.
License requirements: None.
- center (
DisplayCircle¶
-
UserDefinedObjectDisplayContext.
DisplayCircle
¶ Displays a circle for a
UserDefinedObject
. The circle will be created in a plane which is normal to the Z axis of the orientation matrix. (matrix[0-2] is the X axis of the orientation matrix, matrix[3-5] is the Y axis of the orientation matrix, and matrix[6-8] is the Z axis of the orientation matrix.)Signature
DisplayCircle(center, original, radius, filled)
Parameters: - center (
NXOpen.Point3d
) – Center of the arc (absolute coordinates transformed by the orientation matrix) - original (
NXOpen.Matrix3x3
) – Orientation matrix for the arc. - radius (float) – Radius of the arc. Must be greater than zero.
- filled (bool) – True if the interior of the circle is solid filled, otherwise the interior is not filled
New in version NX5.0.0.
License requirements: None.
- center (
DisplayFacets¶
-
UserDefinedObjectDisplayContext.
DisplayFacets
¶ Displays a series of facets for a
UserDefinedObject
.Signature
DisplayFacets(numVertices, numFacets, vertices, normals, typeOfFacet)
Parameters: - numVertices (int) – Number of points to define a facet.
- numFacets (int) – Number of facets to display.
- vertices (list of
NXOpen.Point3d
) – Array of point coordinates which define the vertices of the facets. For example assume num_facets = 2 and num_vertices = 3, then vertices[0-2] defines the point of the first vertex of the first facet, vertices[3-5] defines the second vertex point of the first facet, and vertices[6-8] defines the last vertex point of the first facet. Next vertices[9-11] define the first vertex point of the second facet, vertices[12-14] is the second vertex of the second facet, and last vertices[15-17] defines the last vertex of the second facet. - normals (list of
NXOpen.Vector3d
) – Array of vectors which define the normal to the facet at a vertex point. Normal vectors must be unit vectors, and they should point out away from the faceted object. For example assume num_facets = 2 and num_vertices = 3, then normals[0-8] define the normal vectors at each vertex point in the first facet, and normals[9-17] define the normals for the vertex points of the second facet. More specifically normals[0-2] should define a unit normal vector out away from the facet at the point defined by vertices[0-2]. Likewise normals[3-5] should define a unit normal vector out away from the facet at the point defined by vertices[3-5]. - typeOfFacet (
NXOpen.UserDefinedObjects.UserDefinedObjectDisplayContextFacetType
) – The format of the facet in the facet array
New in version NX5.0.0.
License requirements: None.
DisplayMultiLineAbsoluteRotationScreenSizeStandardText¶
-
UserDefinedObjectDisplayContext.
DisplayMultiLineAbsoluteRotationScreenSizeStandardText
¶ Displays a multi-line “Standard Text” string using “Absolute Rotation and Screen Size Geometry” for a
UserDefinedObject
. A “Standard Text” string uses one of the fonts available from the operating system. “Absolute Rotation and Screen Size Geometry” means the text appears the same physical sized on the screen regardless of the view scale (like “Screen Geometry”), the text remains front-facing and approximately upright (similar to “Screen Geometry”), but the orientation of the text changes as the user rotates the view (like “Absolute Geometry”). The text will be displayed on the XY plane of the absolute coordinate system. This method is not supported for 2D output such as CGM.Signature
DisplayMultiLineAbsoluteRotationScreenSizeStandardText(fontIndex, fontStyle, textCoordinates, referencePointType, strings, textSize)
Parameters: fontIndex – Index of the text font to be used. This must be an index of a standard font. It may be 0 to use the default font. :type fontIndex: int :param fontStyle: The name of a style supported by the given font. Specify NULL to use the default style for the font, which usually is Regular (no bold, no italic). If a non-NULL style does not exist for the font, the font’s default style will be used. :type fontStyle: str :param textCoordinates: Position of text box reference point in Absolute Coordinates :type textCoordinates:
NXOpen.Point3d
:param referencePointType: Reference point type of text box :type referencePointType:NXOpen.UserDefinedObjects.UserDefinedObjectDisplayContextStandardTextRef
:param strings: Array of text strings to display :type strings: list of str :param textSize: see enum values :type textSize:NXOpen.UserDefinedObjects.UserDefinedObjectDisplayContextTextSize
New in version NX8.0.0.
License requirements: None.
DisplayMultiLineAbsoluteStandardText¶
-
UserDefinedObjectDisplayContext.
DisplayMultiLineAbsoluteStandardText
¶ Displays a multi-line “Standard Text” string using “Absolute Geometry” for a
UserDefinedObject
. A “Standard Text” string uses one of the fonts available from the operating system. “Absolute Geometry” means that the text scales and rotates with the view, so it appears larger when you zoom in and smaller when you zoom out. This is the type of text normally used by NX Drafting. Note that the text will be displayed on the Absolute XY plane.Signature
DisplayMultiLineAbsoluteStandardText(fontIndex, fontStyle, textCoordinates, referencePointType, strings, glyphWidth, glyphHeight)
Parameters: fontIndex – Index of the text font to be used. This must be an index of a standard font. It may be 0 to use the default font. :type fontIndex: int :param fontStyle: The name of a style supported by the given font. Specify NULL to use the default style for the font, which usually is Regular (no bold, no italic). If a non-NULL style does not exist for the font, the font’s default style will be used. :type fontStyle: str :param textCoordinates: Position of text box reference point in Absolute Coordinates :type textCoordinates:
NXOpen.Point3d
:param referencePointType: Reference point type of text box :type referencePointType:NXOpen.UserDefinedObjects.UserDefinedObjectDisplayContextStandardTextRef
:param strings: Array of text strings to display :type strings: list of str :param glyphWidth: Width of text in units of the Displayed Part :type glyphWidth: float :param glyphHeight: Height of text in units of the Displayed Part :type glyphHeight: floatNew in version NX8.0.0.
License requirements: None.
DisplayMultiLineScreenStandardText¶
-
UserDefinedObjectDisplayContext.
DisplayMultiLineScreenStandardText
¶ Displays a multi-line “Standard Text” string using “Screen Geometry” for a
UserDefinedObject
. A “Standard Text” string uses one of the fonts available from the operating system. “Screen Geometry” means that the text remains parallel to the screen and appears the same physical size on the screen regardless of the view scale. This method is not supported for 2D output such as CGM. Note that the text will be displayed on the Absolute XY plane.Signature
DisplayMultiLineScreenStandardText(fontIndex, fontStyle, textCoordinates, referencePointType, strings, textSize)
Parameters: fontIndex – Index of the text font to be used. This must be an index of a standard font. It may be 0 to use the default font. :type fontIndex: int :param fontStyle: The name of a style supported by the given font. Specify NULL to use the default style for the font, which usually is Regular (no bold, no italic). If a non-NULL style does not exist for the font, the font’s default style will be used. :type fontStyle: str :param textCoordinates: Position of text box reference point in Absolute Coordinates :type textCoordinates:
NXOpen.Point3d
:param referencePointType: Reference point type of text box :type referencePointType:NXOpen.UserDefinedObjects.UserDefinedObjectDisplayContextStandardTextRef
:param strings: Array of text strings to display :type strings: list of str :param textSize: see enum values :type textSize:NXOpen.UserDefinedObjects.UserDefinedObjectDisplayContextTextSize
New in version NX8.0.0.
License requirements: None.
DisplayPoints¶
-
UserDefinedObjectDisplayContext.
DisplayPoints
¶ Displays a series of points for a
UserDefinedObject
.Signature
DisplayPoints(points, markerType)
Parameters: points – Array of point coordinates. points[0-2] defines the first point, points[3-5] defines the second point, etc. :type points: list of
NXOpen.Point3d
:param markerType: The type of marker displayed for each point :type markerType:NXOpen.UserDefinedObjects.UserDefinedObjectDisplayContextPolyMarker
New in version NX5.0.0.
License requirements: None.
DisplayPolygon¶
-
UserDefinedObjectDisplayContext.
DisplayPolygon
¶ Displays a polygon (a closed set of line segements) for a
UserDefinedObject
. The line segments are defined by an array of points.Signature
DisplayPolygon(points, filled)
Parameters: points – Array of point coordinates which define the polyline. points[0-2] defines the first end point, points[3-5] defines the second end point, etc. :type points: list of
NXOpen.Point3d
:param filled: True if the interior of the polygon is solid filled, otherwise the interior is not filled :type filled: boolNew in version NX5.0.0.
License requirements: None.
DisplayPolyline¶
-
UserDefinedObjectDisplayContext.
DisplayPolyline
¶ Displays a polyline (a connected set of line segements) for a
UserDefinedObject
. The line segments are defined by an array of points.Signature
DisplayPolyline(points)
Parameters: points – Array of point coordinates which define the polyline. points[0-2] defines the first point, points[3-5] defines the second point, etc. :type points: list of
NXOpen.Point3d
New in version NX5.0.0.
License requirements: None.
DisplayScreenStandardText¶
-
UserDefinedObjectDisplayContext.
DisplayScreenStandardText
¶ Displays a single line “Standard Text” string using “Screen Geometry” for a
UserDefinedObject
. A “Standard Text” string uses one of the fonts available from the operating system. “Screen Geometry” means that the text remains parallel to the screen and appears the same physical size on the screen regardless of the view scale. This method is not supported for 2D output such as CGM. Note that the text will be displayed on the Absolute XY plane.Signature
DisplayScreenStandardText(fontIndex, fontStyle, textCoordinates, referencePointType, string, textSize)
Parameters: fontIndex – Index of the text font to be used. This must be an index of a standard font. It may be 0 to use the default font. :type fontIndex: int :param fontStyle: The name of a style supported by the given font. Specify NULL to use the default style for the font, which usually is Regular (no bold, no italic). If a non-NULL style does not exist for the font, the font’s default style will be used. :type fontStyle: str :param textCoordinates: Position of text box reference point in Absolute Coordinates :type textCoordinates:
NXOpen.Point3d
:param referencePointType: Reference point type of text box :type referencePointType:NXOpen.UserDefinedObjects.UserDefinedObjectDisplayContextStandardTextRef
:param string: Text string to display :type string: str :param textSize: see enum values :type textSize:NXOpen.UserDefinedObjects.UserDefinedObjectDisplayContextTextSize
New in version NX8.0.0.
License requirements: None.
DisplayText¶
-
UserDefinedObjectDisplayContext.
DisplayText
¶ Displays a text string using an NX text font for a
UserDefinedObject
.Signature
DisplayText(text, textCoordinates, referencePoint)
Parameters: - text (str) – Text string to display
- textCoordinates (
NXOpen.Point3d
) – Position of text box reference point in abs - referencePoint (
NXOpen.UserDefinedObjects.UserDefinedObjectDisplayContextTextRef
) – Reference point of text box
New in version NX5.0.0.
License requirements: None.
DisplayUnicodeMarker¶
-
UserDefinedObjectDisplayContext.
DisplayUnicodeMarker
¶ Displays a single character in the given font and style centered at the given position.
The character will always be displayed parallel to the screen.
Signature
DisplayUnicodeMarker(unicodeChar, fontIndex, fontStyle, markerCoordinates, markerSize)
Parameters: - unicodeChar (str) – A single Unicode character to display at the given coordinate position.
- fontIndex (int) – Index of the text font to be used. This must be an index of a standard font. It may be 0 to use the default font.
- fontStyle (str) – The name of a style supported by the given font. Specify NULL to use the default style for the font, which usually is Regular (no bold, no italic). If a non-NULL style does not exist for the font, the font’s default style will be used.
- markerCoordinates (
NXOpen.Point3d
) – Position for the center of the marker in Absolute Coordinates - markerSize (float) – In inches on the screen
New in version NX8.0.0.
License requirements: None.
Dispose¶
-
UserDefinedObjectDisplayContext.
Dispose
¶ Frees the memory associated with this object.
After invocation of this method, the object is no longer valid.
Signature
Dispose()
New in version NX5.0.0.
License requirements: None.
GetViewMode¶
-
UserDefinedObjectDisplayContext.
GetViewMode
¶ Get information about the current view mode and display context in which geometry is displayed.
Signature
GetViewMode()
Returns: a tuple Return type: A tuple consisting of (view, isViewModeValid, viewMode, isAttenPtValid, attentionPoint, isDrawingViewOpen). view is a NXOpen.View
. View being displayed isViewModeValid is a bool. True if the view mode was returned and False if no information was available viewMode is aNXOpen.UserDefinedObjects.UserDefinedObjectDisplayContextViewMode
. View mode describes the views shading and face analysis mode - see enum values for more details isAttenPtValid is a bool. True if the attention point was returned and False if no information was available attentionPoint is aNXOpen.Point3d
. The attention point of the geometry just displayed isDrawingViewOpen is a bool. Is the drawing view open for display? If true then geometry may be added to the drawing. If false another view which is not the drawing is openNew in version NX8.5.0.
License requirements: None.