Oasys.PRIMER.SensorDefine class

Constants

SensorDefine.DEFINE_CALC_MATH

Sensor define is *SENSOR_DEFINE_CALC_MATH

SensorDefine.DEFINE_ELEMENT

Sensor define is *SENSOR_DEFINE_ELEMENT

SensorDefine.DEFINE_ELEMENT_SET

Sensor define is *SENSOR_DEFINE_ELEMENT_SET

SensorDefine.DEFINE_FORCE

Sensor define is *SENSOR_DEFINE_FORCE

SensorDefine.DEFINE_FUNCTION

Sensor define is *SENSOR_DEFINE_FUNCTION

SensorDefine.DEFINE_MISC

Sensor define is *SENSOR_DEFINE_MISC

SensorDefine.DEFINE_NODE

Sensor define is *SENSOR_DEFINE_NODE

SensorDefine.DEFINE_NODE_SET

Sensor define is *SENSOR_DEFINE_NODE_SET

Properties

property SensorDefine.calc: string

Mathematical calculation. Can be “ABSSUM”, “MIN”, “MAX”, “MAXMAG”, “MINMAG”, “MULTIPLY”, “SQRE”, “SQRTSQRE”, “SQRT”, “SUMABS”, “SUM”

property SensorDefine.comp: string

Component type. Can be “XX”, “YY”, “ZZ”, “XY”, “YZ”, “ZX”, “AXIAL”, “SHEARS”, “SHEART”

property SensorDefine.crd: integer

Optional coordinate system

property SensorDefine.ctype: string

Sensor type or Output component type. Can be “STRAIN”, “STRESS”, “FORCE”, “MOMENT”, “DLEN” or “FAIL” for SensorDefine.DEFINE_ELEMENT or SensorDefine.DEFINE_ELEMENT_SET and “ACC”, “VEL”, “COORD” or “TEMP” for SensorDefine.DEFINE_NODE or SensorDefine.DEFINE_NODE_SET

property SensorDefine.elemid: integer

Element ID or element set ID when option_SET is active

property SensorDefine.etype: string

Element type. Can be “BEAM”, “SHELL”, “SOLID”, “DISC-ELE”, “SEATBELT” or “TSHELL”

property SensorDefine.exists(read only): boolean

true if *SENSOR_DEFINE exists, false if referred to but not defined

property SensorDefine.ftype: string

Force type. Can be “AIRBAG”, “CONTACT”, “CONTACT2D”, “CPM”, “JOINT”, “JOINTSTIF”, “PRESC-MOT”, “RWALL”, “SPC”, “SPOTWELD”, “X-SECTION”

property SensorDefine.func: integer

Function ID

property SensorDefine.func_sens1: integer

1st Sensor ID if positive or number of sensor ID if negative

property SensorDefine.func_sens10: integer

10th Sensor ID

property SensorDefine.func_sens11: integer

11th Sensor ID

property SensorDefine.func_sens12: integer

12th Sensor ID

property SensorDefine.func_sens13: integer

13th Sensor ID

property SensorDefine.func_sens14: integer

14th Sensor ID

property SensorDefine.func_sens15: integer

15th Sensor ID

property SensorDefine.func_sens16: integer

16th Sensor ID

property SensorDefine.func_sens2: integer

2nd Sensor ID

property SensorDefine.func_sens3: integer

3rd Sensor ID

property SensorDefine.func_sens4: integer

4th Sensor ID

property SensorDefine.func_sens5: integer

5th Sensor ID

property SensorDefine.func_sens6: integer

6th Sensor ID

property SensorDefine.func_sens7: integer

7th Sensor ID

property SensorDefine.func_sens8: integer

8th Sensor ID

property SensorDefine.func_sens9: integer

9th Sensor ID

property SensorDefine.i0: string

I0. Can be ‘KINETIC”, “INTERNAL”, “ERODEKE”, or “ERODEIE” when MTYPE = “MATSUM” or “SOLID”, “SHELL”, “TSHELL”, “BEAM”, or “DISC” when MTYPE = “NFAILE” or “TEMP”, or “VOL” when MTYPE = “CVBAG”, or “PRES”, or “VOL” when MTYPE = “ICVOL”

property SensorDefine.i1: integer/string

I1. Applicable for “ANGLE”, “BNDOUT”, “CURVE”, “CVBAG”, “ICVOL”, “MATSUM” or “NFAILE”

property SensorDefine.i2: integer/string

I2. Applicable only for when MTYPE = “ANGLE”

property SensorDefine.i3: integer/string

I3. Applicable only for MTYPE = “ANGLE”

property SensorDefine.i4: integer/string

I4. Applicable only for MTYPE = “ANGLE”

property SensorDefine.i5: string

I5

property SensorDefine.include: integer

The Include file number that the *SENSOR_DEFINE is in

property SensorDefine.label: integer

SensorDefine number. The sensid property is an alternative name for this

property SensorDefine.layer: integer/string

Layer of integration. Can be “BOT”, “TOP” or “i” to monitor the stress of the ith integration point when ctype = “STRESS”

property SensorDefine.model(read only): integer

The Model number that the *SENSOR_DEFINE is in

property SensorDefine.mtype: string

Entity to be traced. Can be “ANGLE”, “BNDOUT”, “CURVE”, “CVBAG”, “ICVOL”,’MATSUM’, “NFAILE”, “RETRACTOR”, “RIGIDBODY”

property SensorDefine.node1: integer

Node or Node set ID based on option SET for an accelerometer sensor

property SensorDefine.node2: integer

Node ID for an accelerometer sensor

property SensorDefine.option: constant

SENSOR_DEFINE suffix. Can be SensorDefine.DEFINE_CALC_MATH, SensorDefine.DEFINE_ELEMENT, SensorDefine.DEFINE_ELEMENT_SET, SensorDefine.DEFINE_FORCE, SensorDefine.DEFINE_MISC, SensorDefine.DEFINE_NODE, SensorDefine.DEFINE_NODE_SET or SensorDefine.DEFINE_FUNCTION

property SensorDefine.pwr: float

Power (Optional parameters)

property SensorDefine.sens1: integer

1st Sensor ID

property SensorDefine.sens2: integer

2nd Sensor ID

property SensorDefine.sens3: integer

3rd Sensor ID

property SensorDefine.sens4: integer

4th Sensor ID

property SensorDefine.sens5: integer

5th Sensor ID

property SensorDefine.sens6: integer

6th Sensor ID

property SensorDefine.sensid: integer

SensorDefine number. The label property is an alternative name for this

property SensorDefine.setopt: string

Option to process set of data when SET option is specified. Can be “AVG”, “MAX”, “MIN” or “SUM”

property SensorDefine.sf: float

Scale factor (Optional parameters)

property SensorDefine.typeid: integer

ID defined in the associated KEYWORD command

property SensorDefine.vid: integer/string

Vector along which the forces is measured. Can be “X”, “Y”, “Z”, “XL”, “YL”, “ZL”, “XMOMENT”, “YMOMENT”, “ZMOMENT”, “XLMOMENT”, “YLMOMENT”, “ZLMOMENT” or vector ID n in coordinate system CRD for SensorDefine.DEFINE_FORCE or ID of vector along which the nodal values for SensorDefine.DEFINE_NODE and SensorDefine.DEFINE_NODE_SET

Constructor

classmethod SensorDefine(option, model, define_id, type_or_entity_1, entity_2)

Create a new SensorDefine object

Parameters:
Returns:

SensorDefine object

Return type:

dict

Example

To create a new *SENSOR_DEFINE_CALC-MATH in model m with label 100 with CALC option as MAX and SENS1 as -2:

sd1 = Oasys.PRIMER.SensorDefine(Oasys.PRIMER.SensorDefine.DEFINE_CALC_MATH, m, 100, "MAX", -2)

To create a new *SENSOR_DEFINE_MISC in model m with label 10 with MTYPE option as ANGLE:

sd2 = Oasys.PRIMER.SensorDefine(Oasys.PRIMER.SensorDefine.DEFINE_MISC, m, 10, "ANGLE")

To create a new *SENSOR_DEFINE_NODE in model m with label 11 with NODE1 and NODE2 as 5 and 6:

sd3 = Oasys.PRIMER.SensorDefine(Oasys.PRIMER.SensorDefine.DEFINE_NODE, m, 11, 5, 6)

To create a new *SENSOR_DEFINE_FUNCTION in model m with label 12 and FUNCTION ID as 6:

sd4 = Oasys.PRIMER.SensorDefine(Oasys.PRIMER.SensorDefine.DEFINE_FUNCTION, m, 12, 6)

Static methods

classmethod SensorDefine.Create(model, modal=Oasys.gRPC.defaultArg)

Starts an interactive editing panel to create a *SENSOR_DEFINE

Parameters:
  • model (Model) – Model that the *SENSOR_DEFINE will be created in

  • modal (boolean) – Optional. If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal

Returns:

SensorDefine object (or None if not made)

Return type:

dict

Example

To start creating a *SENSOR_DEFINE in model m:

sd = Oasys.PRIMER.SensorDefine.Create(m)
classmethod SensorDefine.First(model)

Returns the first *SENSOR_DEFINE in the model

Parameters:

model (Model) – Model to get first *SENSOR_DEFINE in

Returns:

SensorDefine object (or None if there are no *SENSOR_DEFINEs in the model)

Return type:

SensorDefine

Example

To get the first *SENSOR_DEFINE in model m:

sd = Oasys.PRIMER.SensorDefine.First(m)
classmethod SensorDefine.FirstFreeLabel(model, layer=Oasys.gRPC.defaultArg)

Returns the first free *SENSOR_DEFINE label in the model. Also see SensorDefine.LastFreeLabel(), SensorDefine.NextFreeLabel() and Model.FirstFreeItemLabel()

Parameters:
  • model (Model) – Model to get first free *SENSOR_DEFINE label in

  • layer (Include number) – Optional. Include file (0 for the main file) to search for labels in (Equivalent to First free in layer in editing panels). If omitted the whole model will be used (Equivalent to First free in editing panels)

Returns:

SensorDefine label

Return type:

int

Example

To get the first free *SENSOR_DEFINE label in model m:

label = Oasys.PRIMER.SensorDefine.FirstFreeLabel(m)
classmethod SensorDefine.FlagAll(model, flag)

Flags all of the *SENSOR_DEFINEs in the model with a defined flag

Parameters:
  • model (Model) – Model that all *SENSOR_DEFINEs will be flagged in

  • flag (Flag) – Flag to set on the *SENSOR_DEFINEs

Returns:

No return value

Return type:

None

Example

To flag all of the *SENSOR_DEFINEs with flag f in model m:

Oasys.PRIMER.SensorDefine.FlagAll(m, f)
classmethod SensorDefine.GetAll(model)

Returns a list of SensorDefine objects for all of the *SENSOR_DEFINEs in a model in PRIMER

Parameters:

model (Model) – Model to get *SENSOR_DEFINEs from

Returns:

List of SensorDefine objects

Return type:

list

Example

To make a list of SensorDefine objects for all of the *SENSOR_DEFINEs in model m

sd = Oasys.PRIMER.SensorDefine.GetAll(m)
classmethod SensorDefine.GetFlagged(model, flag)

Returns a list of SensorDefine objects for all of the flagged *SENSOR_DEFINEs in a model in PRIMER

Parameters:
  • model (Model) – Model to get *SENSOR_DEFINEs from

  • flag (Flag) – Flag set on the *SENSOR_DEFINEs that you want to retrieve

Returns:

List of SensorDefine objects

Return type:

list

Example

To make a list of SensorDefine objects for all of the *SENSOR_DEFINEs in model m flagged with f

sd = Oasys.PRIMER.SensorDefine.GetFlagged(m, f)
classmethod SensorDefine.GetFromID(model, number)

Returns the SensorDefine object for a *SENSOR_DEFINE ID

Parameters:
  • model (Model) – Model to find the *SENSOR_DEFINE in

  • number (integer) – number of the *SENSOR_DEFINE you want the SensorDefine object for

Returns:

SensorDefine object (or None if *SENSOR_DEFINE does not exist)

Return type:

SensorDefine

Example

To get the SensorDefine object for *SENSOR_DEFINE 100 in model m

sd = Oasys.PRIMER.SensorDefine.GetFromID(m, 100)
classmethod SensorDefine.Last(model)

Returns the last *SENSOR_DEFINE in the model

Parameters:

model (Model) – Model to get last *SENSOR_DEFINE in

Returns:

SensorDefine object (or None if there are no *SENSOR_DEFINEs in the model)

Return type:

SensorDefine

Example

To get the last *SENSOR_DEFINE in model m:

sd = Oasys.PRIMER.SensorDefine.Last(m)
classmethod SensorDefine.LastFreeLabel(model, layer=Oasys.gRPC.defaultArg)

Returns the last free *SENSOR_DEFINE label in the model. Also see SensorDefine.FirstFreeLabel(), SensorDefine.NextFreeLabel() and see Model.LastFreeItemLabel()

Parameters:
  • model (Model) – Model to get last free *SENSOR_DEFINE label in

  • layer (Include number) – Optional. Include file (0 for the main file) to search for labels in (Equivalent to Highest free in layer in editing panels). If omitted the whole model will be used

Returns:

SensorDefine label

Return type:

int

Example

To get the last free *SENSOR_DEFINE label in model m:

label = Oasys.PRIMER.SensorDefine.LastFreeLabel(m)
classmethod SensorDefine.NextFreeLabel(model, layer=Oasys.gRPC.defaultArg)

Returns the next free (highest+1) *SENSOR_DEFINE label in the model. Also see SensorDefine.FirstFreeLabel(), SensorDefine.LastFreeLabel() and Model.NextFreeItemLabel()

Parameters:
  • model (Model) – Model to get next free *SENSOR_DEFINE label in

  • layer (Include number) – Optional. Include file (0 for the main file) to search for labels in (Equivalent to Highest+1 in layer in editing panels). If omitted the whole model will be used (Equivalent to Highest+1 in editing panels)

Returns:

SensorDefine label

Return type:

int

Example

To get the next free *SENSOR_DEFINE label in model m:

label = Oasys.PRIMER.SensorDefine.NextFreeLabel(m)
classmethod SensorDefine.RenumberAll(model, start)

Renumbers all of the *SENSOR_DEFINEs in the model

Parameters:
  • model (Model) – Model that all *SENSOR_DEFINEs will be renumbered in

  • start (integer) – Start point for renumbering

Returns:

No return value

Return type:

None

Example

To renumber all of the *SENSOR_DEFINEs in model m, from 1000000:

Oasys.PRIMER.SensorDefine.RenumberAll(m, 1000000)
classmethod SensorDefine.RenumberFlagged(model, flag, start)

Renumbers all of the flagged *SENSOR_DEFINEs in the model

Parameters:
  • model (Model) – Model that all the flagged *SENSOR_DEFINEs will be renumbered in

  • flag (Flag) – Flag set on the *SENSOR_DEFINEs that you want to renumber

  • start (integer) – Start point for renumbering

Returns:

No return value

Return type:

None

Example

To renumber all of the *SENSOR_DEFINEs in model m flagged with f, from 1000000:

Oasys.PRIMER.SensorDefine.RenumberFlagged(m, f, 1000000)
classmethod SensorDefine.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)

Allows the user to select *SENSOR_DEFINEs using standard PRIMER object menus

Parameters:
  • flag (Flag) – Flag to use when selecting *SENSOR_DEFINEs

  • prompt (string) – Text to display as a prompt to the user

  • limit (Model or Flag) – Optional. If the argument is a Model then only *SENSOR_DEFINEs from that model can be selected. If the argument is a Flag then only *SENSOR_DEFINEs that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any *SENSOR_DEFINEs can be selected. from any model

  • modal (boolean) – Optional. If selection is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the selection will be modal

Returns:

Number of *SENSOR_DEFINEs selected or None if menu cancelled

Return type:

int

Example

To select *SENSOR_DEFINEs from model m, flagging those selected with flag f, giving the prompt ‘Select *SENSOR_DEFINEs’:

Oasys.PRIMER.SensorDefine.Select(f, 'Select \*SENSOR_DEFINEs', m)

To select *SENSOR_DEFINEs, flagging those selected with flag f but limiting selection to *SENSOR_DEFINEs flagged with flag l, giving the prompt ‘Select *SENSOR_DEFINEs’:

Oasys.PRIMER.SensorDefine.Select(f, 'Select \*SENSOR_DEFINEs', l)
classmethod SensorDefine.Total(model, exists=Oasys.gRPC.defaultArg)

Returns the total number of *SENSOR_DEFINEs in the model

Parameters:
  • model (Model) – Model to get total for

  • exists (boolean) – Optional. true if only existing *SENSOR_DEFINEs should be counted. If false or omitted referenced but undefined *SENSOR_DEFINEs will also be included in the total

Returns:

number of *SENSOR_DEFINEs

Return type:

int

Example

To get the total number of *SENSOR_DEFINEs in model m:

total = Oasys.PRIMER.SensorDefine.Total(m)
classmethod SensorDefine.UnflagAll(model, flag)

Unsets a defined flag on all of the *SENSOR_DEFINEs in the model

Parameters:
  • model (Model) – Model that the defined flag for all *SENSOR_DEFINEs will be unset in

  • flag (Flag) – Flag to unset on the *SENSOR_DEFINEs

Returns:

No return value

Return type:

None

Example

To unset the flag f on all the *SENSOR_DEFINEs in model m:

Oasys.PRIMER.SensorDefine.UnflagAll(m, f)

Instance methods

SensorDefine.AssociateComment(comment)

Associates a comment with a *SENSOR_DEFINE

Parameters:

comment (Comment) – Comment that will be attached to the *SENSOR_DEFINE

Returns:

No return value

Return type:

None

Example

To associate comment c to the *SENSOR_DEFINE sd:

sd.AssociateComment(c)
SensorDefine.Browse(modal=Oasys.gRPC.defaultArg)

Starts an edit panel in Browse mode

Parameters:

modal (boolean) – Optional. If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal

Returns:

no return value

Return type:

None

Example

To Browse *SENSOR_DEFINE sd:

sd.Browse()
SensorDefine.ClearFlag(flag)

Clears a flag on the *SENSOR_DEFINE

Parameters:

flag (Flag) – Flag to clear on the *SENSOR_DEFINE

Returns:

No return value

Return type:

None

Example

To clear flag f for *SENSOR_DEFINE sd:

sd.ClearFlag(f)
SensorDefine.Copy(range=Oasys.gRPC.defaultArg)

Copies the *SENSOR_DEFINE. The target include of the copied *SENSOR_DEFINE can be set using Options.copy_target_include

Parameters:

range (boolean) – Optional. If you want to keep the copied item in the range specified for the current include. Default value is false. To set current include, use Include.MakeCurrentLayer()

Returns:

SensorDefine object

Return type:

SensorDefine

Example

To copy *SENSOR_DEFINE sd into *SENSOR_DEFINE z:

z = sd.Copy()
SensorDefine.DetachComment(comment)

Detaches a comment from a *SENSOR_DEFINE

Parameters:

comment (Comment) – Comment that will be detached from the *SENSOR_DEFINE

Returns:

No return value

Return type:

None

Example

To detach comment c from the *SENSOR_DEFINE sd:

sd.DetachComment(c)
SensorDefine.Edit(modal=Oasys.gRPC.defaultArg)

Starts an interactive editing panel

Parameters:

modal (boolean) – Optional. If this window is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the window will be modal

Returns:

no return value

Return type:

None

Example

To Edit *SENSOR_DEFINE sd:

sd.Edit()
SensorDefine.Flagged(flag)

Checks if the *SENSOR_DEFINE is flagged or not

Parameters:

flag (Flag) – Flag to test on the *SENSOR_DEFINE

Returns:

True if flagged, False if not

Return type:

bool

Example

To check if *SENSOR_DEFINE sd has flag f set on it:

if sd.Flagged(f):
    do_something..
SensorDefine.GetComments()

Extracts the comments associated to a *SENSOR_DEFINE

Returns:

List of Comment objects (or None if there are no comments associated to the node)

Return type:

list

Example

To get the list of comments associated to the *SENSOR_DEFINE sd:

comm_list = sd.GetComments()
SensorDefine.GetParameter(prop)

Checks if a SensorDefine property is a parameter or not. Note that object properties that are parameters are normally returned as the integer or float parameter values as that is virtually always what the user would want. For this function to work the JavaScript interpreter must use the parameter name instead of the value. This can be done by setting the Options.property_parameter_names option to true before calling the function and then resetting it to false afterwards.. This behaviour can also temporarily be switched by using the SensorDefine.ViewParameters() method and ‘method chaining’ (see the examples below)

Parameters:

prop (string) – *SENSOR_DEFINE property to get parameter for

Returns:

Parameter object if property is a parameter, None if not

Return type:

dict

Example

To check if SensorDefine property sd.example is a parameter:

Oasys.PRIMER.Options.property_parameter_names = True
if sd.GetParameter(sd.example):
    do_something...
Oasys.PRIMER.Options.property_parameter_names = False

To check if SensorDefine property sd.example is a parameter by using the GetParameter method:

if sd.ViewParameters().GetParameter(sd.example):
    do_something..
SensorDefine.Keyword()

Returns the keyword for this *SENSOR_DEFINE. Note that a carriage return is not added. See also SensorDefine.KeywordCards()

Returns:

string containing the keyword

Return type:

str

Example

To get the keyword for SensorDefine sd:

key = sd.Keyword()
SensorDefine.KeywordCards()

Returns the keyword cards for the *SENSOR_DEFINE. Note that a carriage return is not added. See also SensorDefine.Keyword()

Returns:

string containing the cards

Return type:

str

Example

To get the cards for sensor define sd:

cards = sd.KeywordCards()
SensorDefine.Next()

Returns the next *SENSOR_DEFINE in the model

Returns:

SensorDefine object (or None if there are no more *SENSOR_DEFINEs in the model)

Return type:

SensorDefine

Example

To get the *SENSOR_DEFINE in model m after *SENSOR_DEFINE sd:

sd = sd.Next()
SensorDefine.Previous()

Returns the previous *SENSOR_DEFINE in the model

Returns:

SensorDefine object (or None if there are no more *SENSOR_DEFINEs in the model)

Return type:

SensorDefine

Example

To get the *SENSOR_DEFINE in model m before *SENSOR_DEFINE sd:

sd = sd.Previous()
SensorDefine.SetFlag(flag)

Sets a flag on the *SENSOR_DEFINE

Parameters:

flag (Flag) – Flag to set on the *SENSOR_DEFINE

Returns:

No return value

Return type:

None

Example

To set flag f for *SENSOR_DEFINE sd:

sd.SetFlag(f)
SensorDefine.ViewParameters()

Object properties that are parameters are normally returned as the integer or float parameter values as that is virtually always what the user would want. This function temporarily changes the behaviour so that if a property is a parameter the parameter name is returned instead. This can be used with ‘method chaining’ (see the example below) to make sure a property argument is correct

Returns:

SensorDefine object

Return type:

dict

Example

To check if SensorDefine property sd.example is a parameter by using the SensorDefine.GetParameter() method:

if sd.ViewParameters().GetParameter(sd.example):
    do_something..
SensorDefine.Xrefs()

Returns the cross references for this *SENSOR_DEFINE

Returns:

Xrefs object

Return type:

dict

Example

To get the cross references for *SENSOR_DEFINE sd:

xrefs = sd.Xrefs()