Text Representation๏ƒ

Text representation commands are used to determine how objects are printed on the Python command line.

Other Classes๏ƒ

class TextReprOptions[source]๏ƒ

Bases: object

The TextReprOptions object is used to configure the output of the Python str() command within Abaqus/CAE. (The str() command is used by the Python print function.) The TextReprOptions object stores the various settings that determine how objects are printed on the Python command line. The TextReprOptions object has no constructor. Abaqus creates the textReprOptions member when a session is started.

Note

This object can be accessed by:

import textRepr
- textReprOptions
session.textReprOptions

Member Details:

setValues(style=None, maxRecursionDepth=None, maxRecursionString='', maxElementsInSequence=None)[source]๏ƒ

This method modifies the TextReprOptions object.

Parameters:
  • style (Optional[Literal[RECURSIVE]], default: None) โ€“ A SymbolicConstant specifying the style of the text representation. Possible values are:RECURSIVE: return a recursive representation of the object.SIMPLE: return a String representing the object as either โ€˜interface objectโ€™, โ€˜dictionary objectโ€™, or โ€˜sequence objectโ€™.The initial value is RECURSIVE.

  • maxRecursionDepth (Optional[Literal[UNLIMITED]], default: None) โ€“ An Int, SymbolicConstant, or None specifying the maximum depth to which the object will be printed. Possible values for the depth are Ints โ‰ฅ 0, the SymbolicConstant UNLIMITED, or None. A value of None implies that the current setting in the TextReprOptions object will be used. If object is not an Abaqus object, maxRecursionDepth has no effect. The default value is None.

  • maxRecursionString (str, default: '') โ€“ A String specifying the string to be returned when the maximum depth of recursion is reached. The string can include a format specifier (%s), which will be substituted by the object type. The initial value is โ€˜%s objectโ€™.

  • maxElementsInSequence (Optional[Literal[UNLIMITED]], default: None) โ€“ An Int or the SymbolicConstant UNLIMITED specifying the maximum number of elements of a sequence to return. Possible values are UNLIMITED or Ints > 0. The initial value is 100. After the maximum number of elements, the remainder are indicated by the string โ€˜โ€ฆโ€™.

indentFile(path, indent='', backup=False, runTest=False)[source]๏ƒ

This method outputs the indented file to the terminal window or backs up the specified file and replaces it.

Parameters:
  • path (str) โ€“ A String specifying the file to be processed.

  • indent (str, default: '') โ€“ A String specifying the amount of indentation to be used. The default value is four spaces of indentation. Custom indentation strings must be flanked by quotation marks (โ€ โ€œ).

  • backup (Union[AbaqusBoolean, bool], default: False) โ€“ A Boolean specifying whether to back up the file specified in the path argument if changes are made. The default value is False.

  • runTest (Union[AbaqusBoolean, bool], default: False) โ€“ A Boolean specifying whether to test the newly indented file to ensure that it is semantically the same after any changes. The default value is False.

Returns:

A Boolean. True, if the indentation is successful; otherwise, False.

Return type:

Boolean

getIndentedRepr(object, maxRecursionDepth=None, maxElementsInSequence=None, significantDigits=6)[source]๏ƒ

This method returns a String with each level of parentheses indented.

Parameters:
  • object โ€“ A Python object to be processed. (The Python object can be an Abaqus object.) This argument can also be a String representation of a Python object obtained from str(object).

  • maxRecursionDepth (Optional[SymbolicConstant], default: None) โ€“ An Int specifying the maximum depth to which the object will be printed, the SymbolicConstant UNLIMITED, or None. A value of None implies that the current setting in the TextReprOptions object will be used. If object is not an Abaqus object, maxRecursionDepth has no effect. The default value is None.You should take care when setting maxRecursionDepth = UNLIMITED because the resulting output can be very large. To limit the output, you should set maxElementsInSequence to a small number.

  • maxElementsInSequence (Optional[SymbolicConstant], default: None) โ€“ An Int specifying the maximum number of elements of a sequence to return or the SymbolicConstant UNLIMITED. The initial value is 100. After the maximum number of elements have been printed, the remainder are indicated by the string โ€˜โ€ฆโ€™.

  • significantDigits (float, default: 6) โ€“ An Int specifying the number of significant digits for Floats in the output. Possible values are 0 < significantDigits โ‰ค 15. The default value is 6.

Returns:

A String.

Return type:

str

getPaths(object, maxRecursionDepth=None, maxElementsInSequence=None, pathRoot='')[source]๏ƒ

This method processes the argument and interprets its structure. It then returns a String containing the object paths of all the child objects found.

Parameters:
  • object โ€“ A Python object to be processed. (The Python object can be an Abaqus object.) This argument can also be a String representation of a Python object.

  • maxRecursionDepth (Optional[SymbolicConstant], default: None) โ€“ An Int specifying the maximum depth to which the object will be printed, the SymbolicConstant UNLIMITED, or None. A value of None implies that the current setting in the TextReprOptions object will be used. If object is not an Abaqus object, maxRecursionDepth has no effect. The default value is None.You should take care when setting maxRecursionDepth = UNLIMITED because the resulting output can be very large. To limit the output, you should set maxElementsInSequence to a small number.

  • maxElementsInSequence (Optional[SymbolicConstant], default: None) โ€“ An Int specifying the maximum number of elements of a sequence to return or the SymbolicConstant UNLIMITED. The initial value is 100. After the maximum number of elements have been printed, the remainder are indicated by the string โ€˜โ€ฆโ€™.

  • pathRoot (str, default: '') โ€“ A String specifying the root of the paths. This String is prepended to each path found. The default value is None, implying that the path to object will be used unless object is a String.

Returns:

A String.

Return type:

str

getTypes(object, maxRecursionDepth=None, maxElementsInSequence=None, pathRoot='')[source]๏ƒ

This method processes the argument, interprets its structure, and returns a String containing all the object types within the object in the form โ€˜TypeName Pathโ€™.

Parameters:
  • object โ€“ An Abaqus object.

  • maxRecursionDepth (Optional[SymbolicConstant], default: None) โ€“ An Int specifying the maximum depth to which the object will be printed, the SymbolicConstant UNLIMITED, or None. A value of None implies that the current setting in the TextReprOptions object will be used. The default value is None.You should take care when setting maxRecursionDepth = UNLIMITED because the resulting output can be very large. To limit the output, you should set maxElementsInSequence to a small number.

  • maxElementsInSequence (Optional[SymbolicConstant], default: None) โ€“ An Int specifying the maximum number of elements of a sequence to return or the SymbolicConstant UNLIMITED. The initial value is 100. After the maximum number of elements have been printed, the remainder are indicated by the string โ€˜โ€ฆโ€™.

  • pathRoot (str, default: '') โ€“ A String specifying the root of the paths. This String is prepended to each path found. The default value is None, implying that the path to object will be used unless object is a String.

Returns:

A String.

Return type:

str

prettyPrint(object, maxRecursionDepth=None, maxElementsInSequence=None, significantDigits=6)[source]๏ƒ

This method prints a formatted version of the object. The prettyPrint function uses getIndentedRepr to format the String representation, but does not save the full text output of getIndentedRepr. Therefore this function can be used in cases where getIndentedRepr would run out of memory.

Parameters:
  • object โ€“ An Abaqus object.

  • maxRecursionDepth (Optional[SymbolicConstant], default: None) โ€“ An Int specifying the maximum depth to which the object will be printed, the SymbolicConstant UNLIMITED, or None. A value of None implies that the current setting in the TextReprOptions object will be used. The default value is None.You should take care when setting maxRecursionDepth = UNLIMITED because the resulting output can be very large. To limit the output, you should set maxElementsInSequence to a small number.

  • maxElementsInSequence (Optional[SymbolicConstant], default: None) โ€“ An Int specifying the maximum number of elements of a sequence to return or the SymbolicConstant UNLIMITED. The initial value is 100. After the maximum number of elements have been printed, the remainder are indicated by the string โ€˜โ€ฆโ€™.

  • significantDigits (float, default: 6) โ€“ An Int specifying the number of significant digits for Floats in the output. Possible values are 0 < significantDigits โ‰ค 15. The default value is 6.

printPaths(object, maxRecursionDepth=None, maxElementsInSequence=None, pathRoot='')[source]๏ƒ

This method prints the object path of the object argument and its members, depending on the maxRecursionDepth argument. The printPaths function uses getPaths to print a list of paths to each of the child objects in object.

Parameters:
  • object โ€“ An Abaqus object. This argument can also be a String representation of an Abaqus object obtained from str(object).

  • maxRecursionDepth (Optional[SymbolicConstant], default: None) โ€“ An Int specifying the maximum depth to which the object will be printed, the SymbolicConstant UNLIMITED, or None. A value of None implies that the current setting in the TextReprOptions object will be used. The default value is None.You should take care when setting maxRecursionDepth = UNLIMITED because the resulting output can be very large. To limit the output, you should set maxElementsInSequence to a small number.

  • maxElementsInSequence (Optional[SymbolicConstant], default: None) โ€“ An Int specifying the maximum number of elements of a sequence to return or the SymbolicConstant UNLIMITED. The initial value is 100. After the maximum number of elements have been printed, the remainder are indicated by the string โ€˜โ€ฆโ€™.

  • pathRoot (str, default: '') โ€“ A String specifying the root of the paths to be printed. This String is prepended to each path found. The default value is None, implying that the path to object will be used.

printTypes(object, maxRecursionDepth=None, maxElementsInSequence=None, pathRoot='')[source]๏ƒ

This method prints the object type. The printTypes function uses getTypes to print a list of all the object types in object.

Parameters:
  • object โ€“ An Abaqus object.

  • maxRecursionDepth (Optional[SymbolicConstant], default: None) โ€“ An Int specifying the maximum depth to which the object will be printed, the SymbolicConstant UNLIMITED, or None. A value of None implies that the current setting in the TextReprOptions object will be used. The default value is None.You should take care when setting maxRecursionDepth = UNLIMITED because the resulting output can be very large. To limit the output, you should set maxElementsInSequence to a small number.

  • maxElementsInSequence (Optional[SymbolicConstant], default: None) โ€“ An Int specifying the maximum number of elements of a sequence to return or the SymbolicConstant UNLIMITED. The initial value is 100. After the maximum number of elements have been printed, the remainder are indicated by the string โ€˜โ€ฆโ€™.

  • pathRoot (str, default: '') โ€“ A String specifying the root of the paths to be printed. This String is prepended to each path found. The default value is None, implying that the path to object will be used.