Oasys.D3PLOT.Measure class

Constants

Measure type

Measure.NODE_ANGLE

Node angle measure type

Measure.NODE_ORIGIN

Node to origin measure type

Measure.NODE_TO_NODE

Node to node measure type

Measure.NODE_TO_PART

Node to part measure type

Measure.PART_TO_PART

Part to part measure type

display

Measure.LABEL

Display measure entity labels

Measure.MAGNITUDE

Display measurement magnitude

Measure.TRANSPARENT

Transparent display of measurements

Measure.VECTOR

Display measurement vector

line

Measure.HIDDEN

Hidden line style for measures

Measure.WIREFRAME

Wireframe line style for measures

number format

Measure.AUTOMATIC

Automatic number format

Measure.GENERAL

General number format, for example 123.4

Measure.SCIENTIFIC

Scientific number format, for example, 1.234E+2

offset

Measure.DEFORM

Consider Deform (Shift deform, Magnify etc.) coordinates for measure calculations

Measure.MODEL_SPACE

Consider model space offsets in the graphics window

show

Measure.SHOW_ALL

Show all measures

Measure.SHOW_CURRENT

Show only the current measure

Measure.SHOW_NONE

Show no measure

Class properties

class property Measure.consider_blanking: boolean

true if calculations in Measure.Data() only consider unblanked elements, false (default) if they consider all elements

class property Measure.current: integer

Index of the measure currently selected for display purposes, starting at 1

class property Measure.display: constant

Display options for measurements. Can be any combination (bitwise OR) of Measure.MAGNITUDE, Measure.VECTOR, Measure.LABEL and Measure.TRANSPARENT

class property Measure.format: constant

Number format for measures. Can be Measure.AUTOMATIC, Measure.SCIENTIFIC or Measure.GENERAL

class property Measure.line: constant

Line style for measures. Can be Measure.HIDDEN or Measure.WIREFRAME

class property Measure.offsets: constant

Whether or not to consider Deform (Shift deform, Magnify etc.) or model space offsets in the calculation of measures. Can be any combination (bitwise OR) of Measure.DEFORM, Measure.MODEL_SPACE

class property Measure.precision: integer

Number of decimal places for scientific or general number format

class property Measure.show: constant

Whether all, only the current or no measure is shown. Can be Measure.SHOW_NONE, Measure.SHOW_CURRENT or Measure.SHOW_ALL

class property Measure.total(read only): integer

Total number of measures in D3PLOT

Properties

property Measure.index(read only): integer

Index where the measure appears on the interactive measure menu, starting at 1. Note that the index of a measure can change when measures with lower indices are deleted

property Measure.name: string

Measure name

property Measure.type(read only): constant

Measure type. Can be Measure.NODE_TO_NODE, Measure.NODE_ANGLE, Measure.NODE_ORIGIN, Measure.NODE_TO_PART or Measure.PART_TO_PART

Constructor

classmethod Measure(type, options)

Create a new Measure object

Parameters:
  • type (constant) – Measure type. Can be Measure.NODE_TO_NODE, Measure.NODE_ANGLE, Measure.NODE_ORIGIN, Measure.NODE_TO_PART or Measure.PART_TO_PART

  • options (dict) –

    Measure options

    model1:

    (integer) Model ID for the first node or part for the measurement. If omitted, the current model will be used

    model2:

    (integer) Model ID for the second node or part for the measurement. If omitted, the current model will be used

    model3:

    (integer) Model ID for the third node for the measurement. If omitted, the current model will be used

    node1:

    (integer) First node for the measurement. If +ve: internal node number starting at 1 (faster), if -ve: external node label

    node2:

    (integer) Second node for the measurement. If +ve: internal node number starting at 1 (faster), if -ve: external node label

    node3:

    (integer) Third node for the measurement. If +ve: internal node number starting at 1 (faster), if -ve: external node label

    part1:

    (integer) First part for the measurement If +ve: internal part number starting at 1 (faster), if -ve: external part label

    part2:

    (integer) Second part for the measurement. If +ve: internal part number starting at 1 (faster), if -ve: external part label

    window:

    (integer) Graphics window ID where the measurement will be created. If omitted, it will be created in the first window

Returns:

Measure object

Return type:

dict

Example

To create a measure between the node with internal index 100 and the part with internal index 3:

m = Oasys.D3PLOT.Measure(Oasys.D3PLOT.Measure.NODE_TO_PART, { node1: 100, part2: 3 })

To create a measure between the node with external label 50 and the part with external label 10:

m = Oasys.D3PLOT.Measure(Oasys.D3PLOT.Measure.NODE_TO_PART, { node1: -50, part2: -10 })

Static methods

classmethod Measure.Delete(type)

Deletes the measure with the given index

Parameters:

type (integer) – Index of the measure to be deleted, starting at 1

Returns:

No return value

Return type:

None

Example

To delete measure m:

index = m.index
Oasys.D3PLOT.Measure.Delete(index)
classmethod Measure.DeleteAll()

Deletes all measures

Returns:

No return value

Return type:

None

Example

To delete all measures:

Oasys.D3PLOT.Measure.DeleteAll()
classmethod Measure.GetFromIndex(type)

Gets the measure object for a given index

Parameters:

type (integer) – Index of the measure, starting at 1

Returns:

Measure object for that index

Return type:

Measure

Example

To get the object for the measure at index 3:

m = Oasys.D3PLOT.Measure.GetFromIndex(3)

Instance methods

Measure.Data()

Returns an object with data for this measure

Returns:

Dict with properties

dx:

(real) X component of the measurement (for types Measure.NODE_TO_NODE, Measure.NODE_ORIGIN, Measure.NODE_TO_PART or Measure.PART_TO_PART)

dy:

(real) Y component of the measurement (for types Measure.NODE_TO_NODE, Measure.NODE_ORIGIN, Measure.NODE_TO_PART or Measure.PART_TO_PART)

dz:

(real) Z component of the measurement (for types Measure.NODE_TO_NODE, Measure.NODE_ORIGIN, Measure.NODE_TO_PART or Measure.PART_TO_PART)

mag:

(real) magnitude of the measurement (length for types Measure.NODE_TO_NODE, Measure.NODE_ORIGIN, Measure.NODE_TO_PART or Measure.PART_TO_PART, angle in degrees for type Measure.NODE_ANGLE)

xy:

(real) Angle in the XY plane in degrees for type Measure.NODE_ANGLE

xz:

(real) Angle in the XZ plane in degrees for type Measure.NODE_ANGLE. The zx property is an alternative name for this

yz:

(real) Angle in the YZ plane in degrees for type Measure.NODE_ANGLE

zx:

(real) Angle in the ZX plane in degrees for type Measure.NODE_ANGLE. The xz property is an alternative name for this

Return type:

dict

Example

To get the X component of the measure object m:

data = m.Data()
dx = data.dx