Oasys.THIS.Datum class¶
Constants¶
- Datum.CONSTANT_X¶
Constant X type datum
- Datum.CONSTANT_Y¶
Constant Y type datum
- Datum.CONSTANT_Y2¶
Constant Y2 type datum
- Datum.FILL_ABOVE_BELOW¶
Fill datum above and below
- Datum.FILL_RIGHT_LEFT¶
Fill datum right and left
- Datum.LABEL_10_POINT¶
Label font size 10
- Datum.LABEL_12_POINT¶
Label font size 12
- Datum.LABEL_14_POINT¶
Label font size 14
- Datum.LABEL_18_POINT¶
Label font size 16
- Datum.LABEL_24_POINT¶
Label font size 24
- Datum.LABEL_8_POINT¶
Label font size 8
- Datum.LABEL_ABOVE_CENTRE¶
Label position above centre
- Datum.LABEL_ABOVE_LEFT¶
Label position above left
- Datum.LABEL_ABOVE_RIGHT¶
Label position above right
- Datum.LABEL_AUTOMATIC¶
Label automatic font size
- Datum.LABEL_BELOW_CENTRE¶
Label position below centre
- Datum.LABEL_BELOW_LEFT¶
Label position below left
- Datum.LABEL_BELOW_RIGHT¶
Label position below right
- Datum.LABEL_BOTTOM_LEFT¶
Label position bottom left
- Datum.LABEL_BOTTOM_RIGHT¶
Label position bottom right
- Datum.LABEL_COURIER_BOLD¶
Label Courier bold font
- Datum.LABEL_COURIER_MEDIUM¶
Label Courier medium font
- Datum.LABEL_DEFAULT¶
Label default font
- Datum.LABEL_HELVETICA_BOLD¶
Label Helvetica bold font
- Datum.LABEL_HELVETICA_MEDIUM¶
Label Helvetica medium font
- Datum.LABEL_HORIZONTAL¶
Label horizonal orientation
- Datum.LABEL_MIDDLE_LEFT¶
Label position middle left
- Datum.LABEL_MIDDLE_RIGHT¶
Label position middle right
- Datum.LABEL_NONE¶
No label
- Datum.LABEL_TIMES_BOLD¶
Label Times bold font
- Datum.LABEL_TIMES_MEDIUM¶
Label Times medium font
- Datum.LABEL_TOP_LEFT¶
Label position top left
- Datum.LABEL_TOP_RIGHT¶
Label position top right
- Datum.LABEL_VERTICAL¶
Label vertical orientation
- Datum.POINTS¶
Points type datum
Properties¶
- property Datum.acronym: string¶
Datum acronym
- property Datum.fill_colour_above: Colour¶
The colour above the datum line
- property Datum.fill_colour_below: Colour¶
The colour below the datum line
- property Datum.fill_colour_between: Colour¶
The colour in between the datum line and the optional second datum line
- property Datum.fill_colour_left: Colour¶
The colour left of the datum line
- property Datum.fill_colour_right: Colour¶
The colour right of the datum line
- property Datum.fill_type: integer¶
The fill type. Can be
Datum.FILL_ABOVE_BELOW
,Datum.FILL_RIGHT_LEFT
. Note that this can only be changed if the datum is of the type Datum.POINTS
- property Datum.label: string¶
Datum label
- property Datum.label2: string¶
Label for optional 2nd datum line
- property Datum.label_colour: Colour¶
The colour of the datum label
- property Datum.label_font: integer¶
The label font. Can be
Datum.LABEL_DEFAULT
,Datum.LABEL_HELVETICA_BOLD
,Datum.LABEL_HELVETICA_MEDIUM
,Datum.LABEL_TIMES_BOLD
,Datum.LABEL_TIMES_MEDIUM
,Datum.LABEL_COURIER_BOLD
,Datum.LABEL_COURIER_MEDIUM
- property Datum.label_orientation: integer¶
The orientation of the label. Can be
Datum.LABEL_HORIZONTAL
,Datum.LABEL_VERTICAL
- property Datum.label_position: integer¶
The label position. Can be
Datum.LABEL_NONE
,Datum.LABEL_ABOVE_CENTRE
,Datum.LABEL_ABOVE_LEFT
,Datum.LABEL_ABOVE_RIGHT
,Datum.LABEL_BELOW_CENTRE
,Datum.LABEL_BELOW_LEFT
,Datum.LABEL_BELOW_RIGHT
,Datum.LABEL_MIDDLE_LEFT
,Datum.LABEL_TOP_LEFT
,Datum.LABEL_BOTTOM_LEFT
,Datum.LABEL_MIDDLE_RIGHT
,Datum.LABEL_TOP_RIGHT
,Datum.LABEL_BOTTOM_RIGHT
- property Datum.label_size: integer¶
The label font size. Can be
Datum.LABEL_AUTOMATIC
,Datum.LABEL_8_POINT
,Datum.LABEL_10_POINT
,Datum.LABEL_12_POINT
,Datum.LABEL_14_POINT
,Datum.LABEL_18_POINT
,Datum.LABEL_24_POINT
,
- property Datum.line_colour: Colour¶
The colour of the datum line
- property Datum.line_style: LineStyle¶
The line style used to draw the datum line
- property Datum.line_width: LineWidth¶
The line width used to draw the datum line
Constructor¶
- classmethod Datum(acronym, type, value, second_value=Oasys.gRPC.defaultArg)¶
Create a new
Datum
object. The datum will be added to all the currently active graphs
- Parameters:
acronym (string) –
Datum
acronymtype (integer) – Specify type of datum line. Can be
Datum.CONSTANT_X
,Datum.CONSTANT_Y
,Datum.CONSTANT_Y2
,Datum.POINTS
value (real or list of reals) – Value for
Datum.CONSTANT_X
,Datum.CONSTANT_Y
orDatum.CONSTANT_Y2
typeDatum
. If it is aDatum.POINTS
typeDatum
then this should be a list of X, Y pairs or a curve ID to copy points fromsecond_value (real) – Optional. Second constant value for use with constant X,Y or Y2 datums and can optionally be provided
- Returns:
Datum object
- Return type:
dict
Example
To create a new datum with acronym my_datum and a constant Y value of 100
d = Oasys.THIS.Datum("my_datum", Oasys.THIS.Datum.CONSTANT_Y, 100)To create a new datum with acronym my_datum and some X, Y points
points = list(range(6)) points[0] = 0.0 points[1] = 10.0 points[2] = 1.0 points[3] = 15.0 points[4] = 2.0 points[5] = 17.0 d = Oasys.THIS.Datum("my_datum", Oasys.THIS.Datum.POINTS, points)
Static methods¶
- classmethod Datum.Delete(datum)¶
Deletes a datum
- Parameters:
datum (string) – Acronym of datum to delete
- Returns:
No return value
- Return type:
None
Example
To delete datum “my_datum”
Oasys.THIS.Datum.Delete("my_datum")
- classmethod Datum.Exists(datum)¶
Checks if a datum exists
- Parameters:
datum (string) – Acronym of datum to check
- Returns:
True if the datum exists, otherwise False
- Return type:
bool
Example
To check if a datum “my_datum” exists
exists = Oasys.THIS.Datum.Exists("my_datum")
- classmethod Datum.First()¶
Returns the first datum
- Returns:
Datum object (or None if there are no datum in the model)
- Return type:
Datum
Example
To get the 1st datum
d = Oasys.THIS.Datum.First()
- classmethod Datum.GetFromAcronym(datum)¶
Returns the datum object for a datum acronym
- Parameters:
datum (string) – Acronym of datum to return object for
- Returns:
Datum object (or None if the datum does not exist)
- Return type:
Datum
Example
To get the datum “my_datum”
d = Oasys.THIS.Datum.GetFromAcronym("my_datum")
Instance methods¶
- Datum.AddToGraph(*graph)¶
Adds a datum to a graph
- Parameters:
graph (int) – Graph to add the datum to. If undefined then the datum is added to all graphs This argument can be repeated if required. Alternatively a single array argument containing the multiple values can be given
- Returns:
No return value
- Return type:
None
Example
To add a datum (d) to graphs 1 and 3:
d.AddToGraph(1, 3)To add a datum (d) to all graphs:
d.AddToGraph()
- Datum.IsOnGraph(graph)¶
Returns whether a datum is on a graph
- Parameters:
graph (int) – Graph id
- Returns:
True if it is on the graph, False otherwise
- Return type:
bool
Example
To check if datum (d) is on graph 3:
d.IsOnGraph(3)
- Datum.Next()¶
Returns the next datum in the model
- Returns:
Datum object (or None if there are no more datums in the model)
- Return type:
Datum
Example
To get the next datum after datum d:
datum = d.Next()
- Datum.RemoveFromGraph(*graph)¶
Removes a datum from a graph
- Parameters:
graph (int) – Graph to remove the datum from. If undefined then the datum is removed from all graphs This argument can be repeated if required. Alternatively a single array argument containing the multiple values can be given
- Returns:
No return value
- Return type:
None
Example
To remove a datum (d) from graphs 1 and 3:
d.RemoveFromGraph(1,3)To remove a datum (d) from all graphs:
d.RemoveFromGraph()