hw Module#

AnimationTool class#

class AnimationTool(page=None, **kwargs)#

Bases: object

Class representing the Animation Tool. Provides user with tools to control the animation and its parameters.

Parameters:
  • page (Union[Page, int, str]) – Page the Animation Tool will be linked to. Default is active page.

  • kwargs (dict) – Attributes of the Animation Tool object.

isAnimating()#

Method to check if page is animating.

Returns:

Returns True if page is animating.

Return type:

bool

next()#

Method to set the next frame of the animation.

previous()#

Method to set the previous frame of the animation.

setAttributes(**kwargs)#

Method to set the animation tool attributes.

Parameters:

kwargs (dict) – Attributes

start(num_cycles=0)#

Method to start the animation.

stop()#

Method to stop the animation.

property currentFrame#

Attribute to set or get the current frame of the animation.

Getter:

Gets the current frame of the animation.

Setter:

Sets the current frame of the animation.

Type:

Union[int, str]

property currentTime#

Attribute to set or get the current time of the animation.

Getter:

Gets the current time of the animation.

Setter:

Sets the current time of the animation.

Type:

Union[float, str]

property endFrame#

Attribute to set or get the end frame of the animation.

Getter:

Gets the end frame of the animation.

Setter:

Sets the end frame of the animation.

Type:

Union[int, str]

property endTime#

Attribute to set or get the endTime of the animation.

Getter:

Gets the end time of the animation.

Setter:

Sets the end time of the animation.

Type:

Union[float, str]

property numberOfFrames#

Attribute to get the number of frames.

Getter:

Gets the number of frames.

Type:

int

property numberOfSteps#

Attribute to get the number of steps.

Getter:

Gets the number of steps.

Type:

int

property page#

Attribute to get the page.

Getter:

Gets the page.

Type:

Page

property startFrame#

Attribute to set or get the start frame of the animation.

Getter:

Gets the start frame of the animation.

Setter:

Sets the start frame of the animation.

Type:

Union[int, str]

property startTime#

Attribute to set or get the start time of the animation.

Getter:

Gets the start time of the animation.

Setter:

Sets the start time of the animation.

Type:

Union[float, str]

CaptureImageTool class#

class CaptureImageTool(*args, **kwargs)#

Bases: object

Class representing the Capture Image Tool. Provides user with tools to define and capture screenshots.

Parameters:

kwargs (dict) – Attributes of the Capture Image Tool object.

capture()#

Method to capture the image and save it as a file. If the file name is not specified, the name will be set to untitled followed by an incremental value (e.g. untitled1.jpg).

setAttributes(**kwargs)#

Method to set the CaptureImageTool attributes.

Parameters:

kwargs (dict) – Attributes

property area#

Attribute to set or get area to capture in image. Default is window. Available options are window or page.

Getter:

Gets the capture image area.

Setter:

Sets the capture image area.

Type:

str

property compression#

Attribute to set or get compression for capture image. Default is 100.

Getter:

Gets the capture image compression.

Setter:

Sets the capture image compression.

Type:

int

property dimension#

Attribute to set or get capture image dimension. Default is pixels. Available options are percent or pixels.

Getter:

Gets the capture image dimension.

Setter:

Sets the capture image dimension.

Type:

str

property file#

Attribute to set or get the capture image file name.

Getter:

Gets the capture image file name.

Setter:

Sets the capture image file name.

Type:

str

property height#

Attribute to set or get the height of the capture image window. Default value is 768 in batch mode, otherwise the page height.

Getter:

Gets the capture image window height.

Setter:

Sets the capture image window height.

Type:

float

property type#

Attribute to set or get the capture image type. Default is clipboard. Available options are jpg, jpeg, png, tif, bmp or clipboard.

Getter:

Gets the capture image type.

Setter:

Sets the capture image type.

Type:

str

property width#

Attribute to set or get the width of the capture image window. Default is 1024 in batch mode, otherwise the page width.

Getter:

Gets the capture image window width.

Setter:

Sets the capture image window width.

Type:

float

CaptureVideoTool class#

class CaptureVideoTool(*args, **kwargs)#

Bases: object

Class representing the Capture Video Tool. Provides user with tools to define and capture video.

Parameters:

kwargs (dict) – Attributes of the Capture Video Tool object.

capture()#

Method to capture the video and save it as a file. If the file name is not specified, the name will be set to untitled followed by an incremental value (e.g. untitled1.avi).

setAttributes(**kwargs)#

Method to set the CaptureVideoTool attributes.

Parameters:

kwargs (dict) – Attributes

property area#

Attribute to set or get area to capture in video. Default is area. Available options are page or area.

Getter:

Gets the capture video area.

Setter:

Sets the capture video area.

Type:

str

property bottom#

Attribute to set or get the bottom corner of the capture video window. Default value is 1.

Getter:

Gets the bottom corner of the capture video window.

Setter:

Sets the bottom corner of the capture video window.

Type:

float

property dimension#

Attribute to set or get capture video dimension. Default is pixels. Available options are percent or pixels.

Getter:

Gets the capture video dimension.

Setter:

Sets the capture video dimension.

Type:

str

property file#

Attribute to set or get the capture video file name.

Getter:

Gets the capture video file name.

Setter:

Sets the capture video file name.

Type:

str

property height#

Attribute to set or get the height of the capture video window. Default value is 768 in batch mode, otherwise the page height.

Getter:

Gets the capture video window height.

Setter:

Sets the capture video window height.

Type:

float

property left#

Attribute to set or get the left corner of the capture video window. Default value is 0.

Getter:

Gets the left corner of the capture video window.

Setter:

Sets the left corner of the capture video window.

Type:

float

property right#

Attribute to set or get the right corner of the capture video window. Default value is 1.

Getter:

Gets the right corner of the capture video window.

Setter:

Sets the right corner of the capture video window.

Type:

float

property top#

Attribute to set or get the top corner of the capture video window. Default value is 0.

Getter:

Gets the top corner of the capture video window.

Setter:

Sets the top corner of the capture video window.

Type:

float

property type#

Attribute to set or get the capture video type. Default is avi. Available options are avi, amf, gif, jpg, jpeg, png, bmp, tif.

Getter:

Gets the capture video type.

Setter:

Sets the capture video type.

Type:

str

property width#

Attribute to set or get the width of the capture video window. Default is 1024 in batch mode, otherwise the page width.

Getter:

Gets the capture video window width.

Setter:

Sets the capture video window width.

Type:

float

Color class#

class Color(*, rgb=(0, 0, 0), hex='#000000', bgr=(0, 0, 0))#

Bases: object

Class representing colors in various formats (RGB, BGR, and Hex). A Color object can be referenced to define an entity color.

property bgr: tuple#

Tuple representing the color in BGR format.

property hex: str#

String representing the color in hexadecimal format.

property postIndex: int#

Sets the color using a HyperView/HyperGraph client index. Valid values are 1-64.

property preIndex: int#

Sets the color using a HyperMesh client index. Valid values are 0-63.

property rgb: tuple#

Tuple representing the color in RGB format.

Font class#

class Font(*args, **kwargs)#

Bases: object

Class representing a font specified by the family, size, and style configuration.

Parameters:

kwargs (dict) – The attributes of the Font.

setAttributes(**kwargs)#

Set the attributes of the Font object.

Parameters:

kwargs (dict) – The attributes of the Font.

property family: str#

Set the font family attribute.

property size: int#

Set the font size attribute.

property style: str#

Set the font style attribute.

HyperGraphWindow class#

class HyperGraphWindow#

Bases: Window

Class representing a HyperGraph Window. Gets a HyperGraph Window for the given page.

delete(entity, objOrId)#

Method to delete an entity.

Parameters:
  • entity (class) – Entity class.

  • objOrId (Union[Entity, int, list, str]) – Entity object, entity ID, list of entity objects, list of entity IDs, or all.

fit(x=True, y=True)#

Method to adjust the view to fit the curves in the plot window.

Parameters:
  • x (bool) – If True, the curves will be fitted along x axis.

  • y (bool) – If True, the curves will be fitted along y axis.

recalculate()#

Method to recalculate the curves in the window.

update()#

Method to recalculate the curves, fit the curves along both x and y axis, and redraw the window.

property axisGradient#

Attribute that activates the axis gradient for the window.

Getter:

Gets the flag for the axis gradient for the window.

Setter:

Sets the flag for the axis gradient for the window.

Type:

bool

property backgroundColor#

Attribute that sets the background color for the window.

Getter:

Gets the background color for the window.

Setter:

Sets the background color for the window.

Type:

Union[int, str, tuple, Color]

property cursorAlwaysVisible#

Attribute that determines whether the animation cursor is always shown in the window.

Getter:

Gets the flag whether the animation cursor is always shown in the window.

Setter:

Sets the whether the animation cursor is always shown in the window.

Type:

bool

property gridLineColor#

Attribute that sets the grid line color for the window.

Getter:

Gets the grid line color for the window.

Setter:

Sets the grid line color for the window.

Type:

Union[int, str, tuple, Color]

property gridLineTransparency#

Attribute that sets the grid line transparency for the window. The value varies between 0-1 to display the gridline’s transparency.

Getter:

Gets the grid line transparency for the window.

Setter:

Sets the grid line transparency for the window.

Type:

float

property lock#

Attribute to set the lock options for the axis in the window. Valid values are:

  • never - The selected axis is automatically scaled to fit new curves that are added to the axis.

  • atimport - The selected axis remains scaled to fit the curve(s) currently assigned to it and it is not scaled to fit new curves.

  • always - The axes are not fit with any of the operations and will always be locked.

Getter:

Gets the lock options for the axis in the window.

Setter:

Sets the lock options for the axis in the window.

Type:

str

property publishFormat#

Attribute to set the publish format for the window. The publish formats available are [‘jpg’,’png’,’bmp’,’gif’,’tif’,’emf’]

Getter:

Gets the publish format for the window.

Setter:

Sets the publish format for the window.

Type:

str

property publishWindow#

Attribute that determines whether to publish the current window contents.

Getter:

Gets the flag to publish the window content.

Setter:

Sets the flag to publish the window content.

Type:

bool

property type#

Attribute to set or get the type of window client.

Getter:

Gets client of the window.

Setter:

Sets client of the window.

Type:

str

XYPlotWindow class#

class XYPlotWindow#

Bases: HyperGraphWindow

Class representing a XYPlot Window. Gets a XYPlot Window for the given page.

property cursorCurveColor#

Attribute that displays the cursor the same color as the curve’s color. Otherwise, it’s black.

Getter:

Gets the flag if the cursor color is same as curve color.

Setter:

Sets the flag if the cursor color is same as curve color.

Type:

bool

property cursorCurveStyle#

Attribute that changes the line style of the animation cursor (solid, dashed, and so on) to match the curves style.

Getter:

Gets the flag if the line style of the animation cursor is same as curve style.

Setter:

Sets the flag if the line style of the animation cursor is same as curve style.

Type:

bool

property cursorDisplay#

Attribute that handles the cursor display in the plotted curve. Valid values are:

  • Square

  • Small bar

  • Medium bar

  • Large bar

  • Custom bar

  • Coordinate marker

Getter:

Gets the cursor display option for the window.

Setter:

Sets the cursor display option for the window.

Type:

str

property cursorThickness#

Attribute to set the cursor thickness for the window. The value for the cursor thickness varies between 1-5

Getter:

Gets the cursor thickness for the window.

Setter:

Sets the cursor thickness for the window.

Type:

int

property invalidPointMode#

Attribute that handles the invalid point in the plotted curve. Valid values are:

  • bridge - handles the blank spaces by creating a bridge in the plotted curve.

  • gap - handles the blank spaces by displaying a gap in the plotted curve.

Getter:

Gets the flag for the uniform aspect ratio for the window.

Setter:

Sets the flag for the uniform aspect ratio for the window.

Type:

bool

property uniformAspectRatio#

Attribute that activates the uniform aspect ratio for the window.

Getter:

Gets the flag for the uniform aspect ratio for the window.

Setter:

Sets the flag for the uniform aspect ratio for the window.

Type:

bool

property zeroLineColor#

Attribute that sets the zero line color for the window.

Getter:

Gets the zero line color for the window.

Setter:

Sets the zero line color for the window.

Type:

Union[int, str, tuple, Color]

ComplexPlotWindow class#

class ComplexPlotWindow#

Bases: HyperGraphWindow

Class representing a ComplexPlot Window. Gets a ComplexPlot Window for the given page.

property axisMode#

Attribute to set the axis mode for the complex plot window. Valid values are:

  • pm - phase magnitude

  • ri - real imaginary

Getter:

Gets the axis mode for the complex plot window.

Setter:

Sets the axis mode for the complex plot window.

Type:

str

property axisProportion#

Attribute to set the axis proportion for the complex plot window. The value for the axis proportion varies between 0.00 to 1.00

Getter:

Gets the axis proportion for the complex plot window.

Setter:

Sets the axis proportion for the complex plot window.

Type:

float

property phaseConstrain#

Attribute that activates the phase constrain for the complex plot window.

Getter:

Gets the flag if the phase constrain is on or off.

Setter:

Sets the flag if the phase constrain is on or off.

Type:

bool

property swapAxis#

Attribute that activates the swap axis for the complex plot window.

Getter:

Gets the flag if the swap axis is on or off.

Setter:

Sets the flag if the swap axis is on or off.

Type:

bool

property zeroLineColor#

Attribute that sets the zero line color for the window.

Getter:

Gets the zero line color for the window.

Setter:

Sets the zero line color for the window.

Type:

Union[int, str, tuple, Color]

BarPlotWindow class#

class BarPlotWindow#

Bases: HyperGraphWindow

Class representing a BarPlot Window. Gets a BarPlot Window for the given page.

barGetValues()#

Method to retrieve the category values and the bar curve data in the bar plot window.

Returns:

A dictionary containing the category values and curve data.

  • The key “category” maps to a list of category values.

  • Each curve’s name maps to a list of float values representing the curve’s y-values.

Return type:

dict

barSetCategoryValue(startValOrIndex: str | int, CategoryValOrList: str | list)#

Method to set or update the category values in the category value list at the specified value or index for the bar plot window.

Parameters:

startValOrIndex – [str, list]

  • The starting value or index in the category values list.

  • If a string is provided, the method searches for this value in the category values list.

  • If an integer is provided, it is used directly as the starting index.

Parameters:

CategoryValOrList – [str, list]

  • The new category value(s) to be set.

  • If a string is provided, it replaces the category value at the specified index.

  • If a list of strings is provided, the values in the list replace the category values starting at the specified index.

property barCategoryLabelAngle#

Attribute to set the category label angle for the bar plot window. Valid values are:

  • diagonal - when the category labels are sloped away from the horizontal axis

  • horizontal - when the category labels are displayed parallel to the horizontal axis.

  • vertical - when the category labels are displayed perpendicular to the horizontal axis.

Getter:

Gets the category label angle for the bar plot window.

Setter:

Sets the category label angle for the bar plot window.

Label:

str

property barCategoryValues#

Attribute to set the category values for the bar plot window (these are the labels across the x-axis).

Getter:

Gets the category values for the bar plot window.

Setter:

Sets the category values for the bar plot window.

Values:

list

property barContributionLabel#

Attribute to set the contibution label for the bar plot window. Valid values are:

  • hide

  • value

  • percentage

Getter:

Gets the contribution label for the bar plot window.

Setter:

Sets the contribution label for the bar plot window.

Label:

str

property barGap#

Attribute to set the bar gap for the bar plot window. The percentage of the total bar width to be used as a gap between bars. Must be between 0 and 100.

Getter:

Gets the bar gap for the bar plot window.

Setter:

Sets the bar gap for the bar plot window.

Gap:

int

property barLabelFont#

Attribute to set the label font for the bar plot window.

Getter:

Gets the label font for the bar plot window.

Setter:

Sets the label font for the bar plot window.

Font:

hw.font

property barLabelFontSize#

Attribute to set the label font size for the bar plot window.

Getter:

Gets the label font size for the bar plot window.

Setter:

Sets the label font size for the bar plot window.

Size:

int

property barLabelFormat#

Attribute to set the label format for the bar plot window.

Getter:

Gets the label format for the bar plot window.

Setter:

Sets the label format for the bar plot window.

Format:

str

property barLabelPrecision#

Attribute to set the label precision for the bar plot window.

Getter:

Gets the label precision for the bar plot window.

Setter:

Sets the label precision for the bar plot window.

Precision:

int

property barLabelVisibility#

Attribute to set the label visibility for the bar plot window.

Getter:

Gets the label visibility for the bar plot window.

Setter:

Sets the label visibility for the bar plot window.

Visibility:

bool

property barOrientation#

Attribute to set the bar orientation for the bar plot window. Depending on the orientation of the category axis, it can ‘vertical’ or ‘horizontal’

Getter:

Gets the bar orientation for the bar plot window.

Setter:

Sets the bar orientation for the bar plot window.

Orientation:

str

property barStyle#

Attribute to set the bar style or method for the bar plot window. Available bar style options are. “stack” “cluster”

Getter:

Gets the bar style for the bar plot window.

Setter:

Sets the bar style for the bar plot window.

Style:

str

property zeroLineColor#

Attribute that sets the zero line color for the bar plot window.

Getter:

Gets the zero line color for the bar plot window.

Setter:

Sets the zero line color for the bar plot window.

Type:

Union[int, str, tuple, Color]

PolarPlotWindow class#

class PolarPlotWindow#

Bases: HyperGraphWindow

Class representing a PolarPlot Window. Gets a PolarPlot Window for the given page.

tiptotailUsePrefence()#

Method to set the tip-to-tail use preference.

property polarMode#

Attribute that sets the mode for the polar plot window. Valid values are phaseVsMag, vector, and radar.

Getter:

Gets the mode for the polar plot window.

Setter:

Sets the mode for the polar plot window.

PolarMode:

str

property quadrantLineColor#

Attribute that sets the quadrant line color for the polar plot window.

Getter:

Gets the quadrant line color for the polar plot window.

Setter:

Sets the quadrant line color for the polar plot window.

Type:

Union[int, str, tuple, Color]

property tiptotailCurveList#

Attribute that sets the list of curve (curveiDs or curveObj) included in the tip-to-tail curves in the polar plot window.

Getter:

Gets the list of curves (curveiDs or curveObj) included in the tip-to-tail curves in the polar plot window.

Setter:

Sets the list of curves (curveiDs or curveObj) included in the tip-to-tail curves in the polar plot window.

CurveList:

list

property tiptotailLineStyle#

Attribute that sets the line style for the tip-to-tail curves in the polar plot window. It represents the style of the arrow in a polar plot. It varies from 1 to 5 that corresponds to a style.

Getter:

Gets the line style for the tip-to-tail curves in the polar plot window.

Setter:

Sets the line style for the tip-to-tail curves in the polar plot window.

Style:

int

property tiptotailLineThickness#

Attribute that sets the line thickness for the tip-to-tail curves in the polar plot window. It represents the thickness of the arrow in a polar plot. It accepts a value between 0 and 3 that corresponds to a thickness.

Getter:

Gets the line thickness for the tip-to-tail curves in the polar plot window.

Setter:

Sets the line thickness for the tip-to-tail curves in the polar plot window.

Thickness:

int

property tiptotailSelectionMethod#

Attribute that sets the selected method for the tip-to-tail curves in the polar plot window. It is only valid for polar plots, vector mode. Valid values are:

  • none - None of the vectors is selected. Manual selection is not allowed.

  • all - All vectors are selected. Manual selection is not allowed.

  • displayed - Based only on the displayed vectors, you can select vectors manually.

  • selected - Based on all the vectors of the plot, you make selections.

Getter:

Gets the selected method or the tip-to-tail curves in the polar plot window.

Setter:

Sets the selected method or the tip-to-tail curves in the polar plot window.

Method:

str

property tiptotailVectorCount#

Attribute that sets the number of vectors included in the tip-to-tail curves in the polar plot window.

Getter:

Gets the number of vectors included in the tip-to-tail curves in the polar plot window.

Setter:

Sets the number of vectors included in the tip-to-tail curves in the polar plot window.

Count:

int

HyperViewWindow class#

class HyperViewWindow#

Bases: Window

addModelAndResult(model=None, result=None, overlay=False, template='none')#

Method to load model and result.

Parameters:
  • model (str) – Model file name.

  • result (str) – Result file name.

  • overlay (bool) – If True, overlays the model.

  • template (str) – Template used to load model and result.

addResult(resFiles, replace=False)#

Method to add results.

Parameters:
  • resFiles (Union[str, list]) – Result file name.

  • replace (bool) – If True, replaces the currently loaded result file.

delete(entity, objOrId)#

Method to delete an entity.

Parameters:
  • entity (class) – Entity class.

  • objOrId (Union[Entity, int, list, str]) – Entity object, entity ID, list of entity objects, list of entity IDs, or all.

fit(mode: str = 'model')#

Method to adjust the view to fit the objects in the modeling window.

Parameters:

mode (str) – Mode of the fit operation. Valid values are model (default), selected, and allframes.

getActiveModel()#

Method to get the active model object.

Returns:

Model object.

Return type:

Model

getModel(id: int)#

Method to get the model object.

Parameters:

id (int) – The ID of the model.

Returns:

Model object.

Return type:

Model

getModels() list#

Method to get the model object list.

Returns:

Model object list.

Return type:

list

getResultDefinitionList(type: str)#

Method to get the ResultDefinition object list.

Parameters:

type (int) – Type of ResultDefinition (scalar, vector, or tensor)

Returns:

Model object.

Return type:

Model

setActiveModel(id: int)#

Method to set the active model and returns model object.

Parameters:

id (int) – The ID of the model.

Returns:

Model object.

Return type:

Model

update()#

Method to fit the model and draw the window.

property sectionFeatureLines#

Attribute to set or get feature lines of the Section cut.

Getter:

Gets the feature lines of the SectionCut.

Setter:

Sets the feature lines of the SectionCut.

Type:

bool

property sectionTransparency#

Attribute to set or get transparency of the Section cut.

Getter:

Gets the transparency of the SectionCut.

Setter:

Sets the transparency of the SectionCut.

Type:

bool

Page class#

class Page(layout=0, title='Untitled', _obj=None, _id=0)#

Bases: object

Class representing a page of the application. The constructor raises an exception if not pointed to a valid page.

Parameters:
  • layout (int) – The page layout.

  • title (str) – The page title.

draw(updateInterface: bool = False)#

Method to draw the page.

Parameters:

updateInterface (bool) – If True, the graphics are updated.

getAverageAnimationFramerate()#

Method to get the average animation frame rate.

Returns:

Animation frame rate.

Return type:

int

getNumberOfWindows() int#

Method to get the number of windows on a page.

Returns:

Number of windows on a page.

Return type:

int

isAnimating()#

Method to check if page is animating.

Returns:

Returns True if page is animating.

Return type:

bool

setAttributes(**kwargs)#

Method to set the page attributes.

Parameters:

kwargs (dict) – attributes

startAnimation(num_cycles=0)#

Method to start the animation.

Parameters:

num_cycles (int) – Number of animation cycles defining how many times animation will be repeated (default 0).

stopAnimation()#

Method to stop the animation.

property id#

Attribute to get the ID of the page.

Getter:

Gets the ID of the page.

Type:

int

property layout#

Attribute to set or get the window layout of the page. Valid values are 0-19.

Getter:

Gets layout of the page.

Setter:

Sets layout of the page.

Type:

int

property title#

Attribute to set or get the page title.

Getter:

Gets title of the page.

Setter:

Sets title of the page.

Type:

str

property titleAsDisplayed#

Attribute to get the displayed title (after evaluation of any embedded expressions).

Getter:

Gets the displayed page title.

Type:

str

Session class#

class Session#

Bases: object

A singleton class representing the Session. All session level attributes and methods are defined in this class.

close()#

Method to close the session.

delete(entity, objOrid)#

Method to delete an entity.

Parameters:
  • entity (Page) – Entity to be deleted. Currently only supported for Page class.

  • objOrid (Union[int, str, Page, list]) – ID, title, Page object or list of IDs, titles or Page objects.

classmethod get(tag, id: Any | None = None, label: str | None = None, title: str | None = None, page: int | Page | None = None, window: int | Window | None = None, model=None, curve: Any | None = None, reference: str | None = None, labelAsDisplayed: str | None = None, name: str | None = None, curveLabelAsDisplayed: str | None = None, curveLabel: str | None = None, operation: str | None = None)#

Method to get an entity object of class Page, Window, Model, Result, ResultDefinitionScalar, ResultDefinitionVector, ResultDefinitionTensor, ResultDefinitionIso, ResultDisplayIso, LegendScalar, LegendTensor, LegendVector, Note, CurveXY, CurveComplex, CurvePolar, CurveBar ,DatumHorizontal, DatumVertical, AxisHorizontal, AxisVertical, Header, Footer, MathXY, SectionCutPlanar, SectionCutSpherical, MeasureStaticMinMax, MeasureDynamicMinMax, MeasurePosition, MeasureDistanceBetween, MeasureDistanceIncremental, MeasureDisplacementRelative, MeasureDistanceMinimum, MeasureAngleBetween, MeasureAngleRelative, MeasureAngleIncremental, MeasureCircleRadius, MeasureContourElemental, MeasureYawPitchRoll, MeasureContourNodal, MeasureNodePath, MeasureContourComponent.

Parameters:
  • tag (class) – The class of the entity to get.

  • id (int) – id of the entity.

  • label (str) – label of the entity.

  • title (str) – title of the entity

  • page (Union[Page, int]) – Page of the entity specified as either a Page object or ID. Default is active page.

  • window (Union[Window, int]) – Window of the entity specified as either a Window object or ID. Default is active window.

  • model (Union[Model, int]) – Model specified either as a Model object or ID.

getHWversion(detail=2)#

Method to get the Hyperworks version.

Parameters:

detail (str) – Value to show detail HW version details.Default is 2.

getMultiCoreMode()#

Method to get the MultiCore mode. Applicable for HyperView client.

Returns:

Returns True if MultiCore profile is loaded.

Return type:

bool

getPages() list#

Method to get the pages.

Returns:

List of Page class objects.

Return type:

list

getWindows(page: Any | None = None) list#

Method to get the windows in specified page.

Parameters:

page (Union[Page, int, str]) – Page for the windows. Default is active page.

Returns:

List of windows in given page.

Return type:

list

load(filename, append=True)#

Method to load the session.

Parameters:
  • filename (str) – Session file name.

  • append (bool) – If True, appends the given file to the existing session. Default is True.

new()#

Method to create a new session.

save(filename=None)#

Method to save the session.

Parameters:

filename (str) – Session file name. If filename is not specified, it will save the session as Untitled.mvw.

setActive(tag, id: Any | None = None, title: str | None = None, page: int | Page | None = None, window: int | Window | None = None, model=None)#

Method to set the active entity like Page, Window, or Model.

Parameters:
  • tag (Page, Window or Model) – Entity to be set as active. Applicable for Page, Window or Model.

  • id (int) – ID of the entity.

  • title (str) – Title of the entity. Applicable for Page and Model.

  • page (Union[Page, int]) – Page of the entity specified as either a Page object or ID. Default is active page.

  • window (Union[Window, int]) – Window of the entity specified as either a Window object or ID. Default is active window.

  • model (Union[Model, int]) – Model specified either as a Model object or ID.

Window class#

class Window(page=None, window=None, id=None)#

Bases: object

Class representing a Window. Get a Window for the given page. The constructor raises an exception if not pointed to a valid window.

Parameters:
  • page (Union[int, Page, str]) – The page of the window.

  • window (Union[int, Window]) – The specific window.

  • id (int) – ID of the window

draw()#

Method to draw the window.

erase()#

Method to erase window content.

getDisplayOptionList()#

Method to get the list of post display options.

Returns:

Returns the list of post display options.

Return type:

list

getStatusDisplay(option: str = '')#

Method to get the display option setting.

Parameters:

option (str) – Available options are tracing, tracking, contour, iso value, tensor, vector, legend, section cut, measure, notes, axisymmetry, and perspective.

Returns:

Status of display option.

Return type:

bool

isEmpty()#

Method to check if window is empty.

Returns:

Returns True if window is empty.

Return type:

bool

setAttributes(**kwargs)#

Method to set window attributes.

Parameters:
  • kwargs – Attributes

  • type – dict

setStatusDisplay(option: str = '', status: bool = True)#

Method to set the display options.

Parameters:
  • option (str) – Available options are tracing, tracking, contour, iso value, tensor, vector, legend, section cut, measure, notes, axisymmetry, and perspective.

  • status (bool) – Status of display option.

property graphicsHeight#

Attribute to get the window height.

Getter:

Window height.

Type:

int

property graphicsWidth#

Attribute to get the window width.

Getter:

Window width.

Type:

int

property id#

Attribute to get the window ID.

Getter:

Gets the window ID.

Type:

int

property page#

Attribute to get the Page class object.

Getter:

Gets page object.

Type:

Page class object

property publishFormat#

Attribute to set or get the publish format for the Window. For HV valid values are ‘jpg’,’png’,’bmp’,’gif’,’tif’,’avi’,’h3d’. For HG valid values are ‘jpg’,’png’,’bmp’,’gif’,’tif’,’emf’.

Getter:

Gets the publish format for the Window.

Setter:

Sets the publish format for the Window.

Type:

str

property type#

Attribute to set or get the type of window client.

Getter:

Gets client of the window.

Setter:

Sets client of the window. Currently supported types are “fepre”, “animation”, “xy”, “bar”, “complex”, “polar”, “plot3d”.

Type:

str

evalHWC function#

evalHWC(command_or_file: str)#

Evaluates a HWC based expression. Alternatively, if supplied a path to a HWC command file, it executes the command file.

Parameters:

command_or_file (str) – HWC expression or path to HWC command file.

Example - Clearing scalar and iso plot using HWC in Python#
import hw

hw.evalHWC('result scalar clear "Stress, vonMises, Max, Analysis System')
hw.evalHWC('result iso clear')

evalTcl function#

evalTcl(command: str)#

Evaluates a Tcl based expression.

Parameters:

command (str) – Tcl expression

Returns:

The return value of the evaluated Tcl expression.

Return type:

str

Example - Sourcing a Tcl file in Python and assigning the returned value to a variable#
import hw

returned_str = hw.evalTcl('source {C:/Scripts/post_processing_util.tcl')