Oasys.PRIMER.SensorControl class¶
Properties¶
- property SensorControl.cntlid: integer¶
SensorControl
number. Thelabel
property is an alternative name for this
- property SensorControl.estyp: string¶
Element Set Type to be controlled. Can be “BEAM”, “DISC”, “SHELL”, “SOLID”, “TSHELL”
- property SensorControl.exists(read only): boolean¶
true if *SENSOR_CONTROL exists, false if referred to but not defined
- property SensorControl.initstt: string¶
Initial status. Can be “On” or “Off”
- property SensorControl.label: integer¶
SensorControl
number. Thecntlid
property is an alternative name for this
- property SensorControl.nrep: integer¶
Number of repeat of cycle of switches
- property SensorControl.swit1: integer¶
ID of 1st switch
- property SensorControl.swit2: integer¶
ID of 2nd switch
- property SensorControl.swit3: integer¶
ID of 3rd switch
- property SensorControl.swit4: integer¶
ID of 4th switch
- property SensorControl.swit5: integer¶
ID of 5th switch
- property SensorControl.swit6: integer¶
ID of 6th switch
- property SensorControl.swit7: integer¶
ID of 7th switch
- property SensorControl.timeoff: integer¶
Flag for offset of time in curve
- SensorControl.timeoff/idiscl
Flag for offset of time in curve./Flag for the reference length of the discrete element
- property SensorControl.type: string¶
Entity to be controlled. Can be “AIRBAG”, “BAGVENTPOP”, “BELTPRET”, “BELTRETRA”, “BELTSLIP”, “CONTACT”, “CONTACT2D”, “CNRB”, “DEF2RIG”, “DISC-ELE”, “DISC-ELES”, “ELESET”, “FUNCTION”, “JOINT”, “JOINTSTIFF”, “LOADTHM”, “M PRESSURE”, “RWALL”, “SPC”, “SPOTWELD”
- property SensorControl.typeid: integer¶
ID of entity to be controlled if type is not FUNCTION or input value for FUNCTION
Constructor¶
- classmethod SensorControl(model, sensor_control_id, type, type_id=Oasys.gRPC.defaultArg, estyp=Oasys.gRPC.defaultArg)¶
Create a new
SensorControl
object
- Parameters:
model (Model) –
Model
that *SENSOR_CONTROL will be created insensor_control_id (integer) –
SensorControl
idtype (string) – Entity type to be controlled. Can be “AIRBAG”, “BAGVENTPOP”, “BELTPRET”, “BELTRETRA”, “BELTSLIP”, “CONTACT”, “CONTACT2D”, “DEF2RIG”, “DISC-ELE”, “DISC-ELES”, “ELESET”, “FUNCTION”, “JOINT”, “JOINTSTIFF”, “M PRESSURE”, “RWALL”, “SPC”, “SPOTWELD”
type_id (integer) – Optional. ID of entity to be controlled if type is not FUNCTION or input value for FUNCTION
estyp (string) – Optional. Element Set Type to be controlled. Can be “BEAM”, “DISC”, “SHELL”, “SOLID”, “TSHELL”. Required only if Type argument is “ELESET”
- Returns:
SensorControl object
- Return type:
dict
Example
To create a new *SENSOR_CONTROL in model m with label 100 and type JOINT:
sc = Oasys.PRIMER.SensorControl(m, 100, "JOINT")
Static methods¶
- classmethod SensorControl.Create(model, modal=Oasys.gRPC.defaultArg)¶
Starts an interactive editing panel to create a *SENSOR_CONTROL
- Parameters:
model (Model) –
Model
that the *SENSOR_CONTROL will be created inmodal (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:
SensorControl object (or None if not made)
- Return type:
dict
Example
To start creating a *SENSOR_CONTROL in model m:
sc = Oasys.PRIMER.SensorControl.Create(m)
- classmethod SensorControl.First(model)¶
Returns the first *SENSOR_CONTROL in the model
- Parameters:
model (Model) –
Model
to get first *SENSOR_CONTROL in- Returns:
SensorControl object (or None if there are no *SENSOR_CONTROLs in the model)
- Return type:
SensorControl
Example
To get the first *SENSOR_CONTROL in model m:
sc = Oasys.PRIMER.SensorControl.First(m)
- classmethod SensorControl.FirstFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the first free *SENSOR_CONTROL label in the model. Also see
SensorControl.LastFreeLabel()
,SensorControl.NextFreeLabel()
andModel.FirstFreeItemLabel()
- Parameters:
- Returns:
SensorControl label
- Return type:
int
Example
To get the first free *SENSOR_CONTROL label in model m:
label = Oasys.PRIMER.SensorControl.FirstFreeLabel(m)
- classmethod SensorControl.FlagAll(model, flag)¶
Flags all of the *SENSOR_CONTROLs in the model with a defined flag
- Parameters:
model (Model) –
Model
that all *SENSOR_CONTROLs will be flagged inflag (Flag) – Flag to set on the *SENSOR_CONTROLs
- Returns:
No return value
- Return type:
None
Example
To flag all of the *SENSOR_CONTROLs with flag f in model m:
Oasys.PRIMER.SensorControl.FlagAll(m, f)
- classmethod SensorControl.GetAll(model)¶
Returns a list of SensorControl objects for all of the *SENSOR_CONTROLs in a model in PRIMER
- Parameters:
model (Model) –
Model
to get *SENSOR_CONTROLs from- Returns:
List of SensorControl objects
- Return type:
list
Example
To make a list of SensorControl objects for all of the *SENSOR_CONTROLs in model m
sc = Oasys.PRIMER.SensorControl.GetAll(m)
- classmethod SensorControl.GetFlagged(model, flag)¶
Returns a list of SensorControl objects for all of the flagged *SENSOR_CONTROLs in a model in PRIMER
- Parameters:
model (Model) –
Model
to get *SENSOR_CONTROLs fromflag (Flag) – Flag set on the *SENSOR_CONTROLs that you want to retrieve
- Returns:
List of SensorControl objects
- Return type:
list
Example
To make a list of SensorControl objects for all of the *SENSOR_CONTROLs in model m flagged with f
sc = Oasys.PRIMER.SensorControl.GetFlagged(m, f)
- classmethod SensorControl.GetFromID(model, number)¶
Returns the SensorControl object for a *SENSOR_CONTROL ID
- Parameters:
model (Model) –
Model
to find the *SENSOR_CONTROL innumber (integer) – number of the *SENSOR_CONTROL you want the SensorControl object for
- Returns:
SensorControl object (or None if *SENSOR_CONTROL does not exist)
- Return type:
SensorControl
Example
To get the SensorControl object for *SENSOR_CONTROL 100 in model m
sc = Oasys.PRIMER.SensorControl.GetFromID(m, 100)
- classmethod SensorControl.Last(model)¶
Returns the last *SENSOR_CONTROL in the model
- Parameters:
model (Model) –
Model
to get last *SENSOR_CONTROL in- Returns:
SensorControl object (or None if there are no *SENSOR_CONTROLs in the model)
- Return type:
SensorControl
Example
To get the last *SENSOR_CONTROL in model m:
sc = Oasys.PRIMER.SensorControl.Last(m)
- classmethod SensorControl.LastFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the last free *SENSOR_CONTROL label in the model. Also see
SensorControl.FirstFreeLabel()
,SensorControl.NextFreeLabel()
and seeModel.LastFreeItemLabel()
- Parameters:
- Returns:
SensorControl label
- Return type:
int
Example
To get the last free *SENSOR_CONTROL label in model m:
label = Oasys.PRIMER.SensorControl.LastFreeLabel(m)
- classmethod SensorControl.NextFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the next free (highest+1) *SENSOR_CONTROL label in the model. Also see
SensorControl.FirstFreeLabel()
,SensorControl.LastFreeLabel()
andModel.NextFreeItemLabel()
- Parameters:
- Returns:
SensorControl label
- Return type:
int
Example
To get the next free *SENSOR_CONTROL label in model m:
label = Oasys.PRIMER.SensorControl.NextFreeLabel(m)
- classmethod SensorControl.RenumberAll(model, start)¶
Renumbers all of the *SENSOR_CONTROLs in the model
- Parameters:
model (Model) –
Model
that all *SENSOR_CONTROLs will be renumbered instart (integer) – Start point for renumbering
- Returns:
No return value
- Return type:
None
Example
To renumber all of the *SENSOR_CONTROLs in model m, from 1000000:
Oasys.PRIMER.SensorControl.RenumberAll(m, 1000000)
- classmethod SensorControl.RenumberFlagged(model, flag, start)¶
Renumbers all of the flagged *SENSOR_CONTROLs in the model
- Parameters:
model (Model) –
Model
that all the flagged *SENSOR_CONTROLs will be renumbered inflag (Flag) – Flag set on the *SENSOR_CONTROLs 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_CONTROLs in model m flagged with f, from 1000000:
Oasys.PRIMER.SensorControl.RenumberFlagged(m, f, 1000000)
- classmethod SensorControl.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)¶
Allows the user to select *SENSOR_CONTROLs using standard PRIMER object menus
- Parameters:
flag (Flag) – Flag to use when selecting *SENSOR_CONTROLs
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_CONTROLs from that model can be selected. If the argument is aFlag
then only *SENSOR_CONTROLs that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any *SENSOR_CONTROLs can be selected. from any modelmodal (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_CONTROLs selected or None if menu cancelled
- Return type:
int
Example
To select *SENSOR_CONTROLs from model m, flagging those selected with flag f, giving the prompt ‘Select *SENSOR_CONTROLs’:
Oasys.PRIMER.SensorControl.Select(f, 'Select \*SENSOR_CONTROLs', m)To select *SENSOR_CONTROLs, flagging those selected with flag f but limiting selection to *SENSOR_CONTROLs flagged with flag l, giving the prompt ‘Select *SENSOR_CONTROLs’:
Oasys.PRIMER.SensorControl.Select(f, 'Select \*SENSOR_CONTROLs', l)
- classmethod SensorControl.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Sketches all of the flagged *SENSOR_CONTROLs in the model. The *SENSOR_CONTROLs will be sketched until you either call
SensorControl.Unsketch()
,SensorControl.UnsketchFlagged()
,Model.UnsketchAll()
, or delete the model
- Parameters:
model (Model) –
Model
that all the flagged *SENSOR_CONTROLs will be sketched inflag (Flag) – Flag set on the *SENSOR_CONTROLs that you want to sketch
redraw (boolean) – Optional. If model should be redrawn or not after the *SENSOR_CONTROLs are sketched. If omitted redraw is true. If you want to sketch flagged *SENSOR_CONTROLs several times and only redraw after the last one then use false for redraw and call
View.Redraw()
- Returns:
No return value
- Return type:
None
Example
To sketch all *SENSOR_CONTROLs flagged with flag in model m:
Oasys.PRIMER.SensorControl.SketchFlagged(m, flag)
- classmethod SensorControl.Total(model, exists=Oasys.gRPC.defaultArg)¶
Returns the total number of *SENSOR_CONTROLs in the model
- Parameters:
model (Model) –
Model
to get total forexists (boolean) – Optional. true if only existing *SENSOR_CONTROLs should be counted. If false or omitted referenced but undefined *SENSOR_CONTROLs will also be included in the total
- Returns:
number of *SENSOR_CONTROLs
- Return type:
int
Example
To get the total number of *SENSOR_CONTROLs in model m:
total = Oasys.PRIMER.SensorControl.Total(m)
- classmethod SensorControl.UnflagAll(model, flag)¶
Unsets a defined flag on all of the *SENSOR_CONTROLs in the model
- Parameters:
model (Model) –
Model
that the defined flag for all *SENSOR_CONTROLs will be unset inflag (Flag) – Flag to unset on the *SENSOR_CONTROLs
- Returns:
No return value
- Return type:
None
Example
To unset the flag f on all the *SENSOR_CONTROLs in model m:
Oasys.PRIMER.SensorControl.UnflagAll(m, f)
- classmethod SensorControl.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all *SENSOR_CONTROLs
- Parameters:
model (Model) –
Model
that all *SENSOR_CONTROLs will be unblanked inredraw (boolean) – Optional. If model should be redrawn or not after the *SENSOR_CONTROLs are unsketched. If omitted redraw is true. If you want to unsketch several things and only redraw after the last one then use false for redraw and call
View.Redraw()
- Returns:
No return value
- Return type:
None
Example
To unsketch all *SENSOR_CONTROLs in model m:
Oasys.PRIMER.SensorControl.UnsketchAll(m)
- classmethod SensorControl.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all flagged *SENSOR_CONTROLs in the model
- Parameters:
model (Model) –
Model
that all *SENSOR_CONTROLs will be unsketched inflag (Flag) – Flag set on the *SENSOR_CONTROLs that you want to unsketch
redraw (boolean) – Optional. If model should be redrawn or not after the *SENSOR_CONTROLs are unsketched. If omitted redraw is true. If you want to unsketch several things and only redraw after the last one then use false for redraw and call
View.Redraw()
- Returns:
No return value
- Return type:
None
Example
To unsketch all *SENSOR_CONTROLs flagged with flag in model m:
Oasys.PRIMER.SensorControl.UnsketchAll(m, flag)
Instance methods¶
- SensorControl.AssociateComment(comment)¶
Associates a comment with a *SENSOR_CONTROL
- Parameters:
comment (Comment) –
Comment
that will be attached to the *SENSOR_CONTROL- Returns:
No return value
- Return type:
None
Example
To associate comment c to the *SENSOR_CONTROL sc:
sc.AssociateComment(c)
- SensorControl.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_CONTROL sc:
sc.Browse()
- SensorControl.ClearFlag(flag)¶
Clears a flag on the *SENSOR_CONTROL
- Parameters:
flag (Flag) – Flag to clear on the *SENSOR_CONTROL
- Returns:
No return value
- Return type:
None
Example
To clear flag f for *SENSOR_CONTROL sc:
sc.ClearFlag(f)
- SensorControl.Copy(range=Oasys.gRPC.defaultArg)¶
Copies the *SENSOR_CONTROL. The target include of the copied *SENSOR_CONTROL 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:
SensorControl object
- Return type:
SensorControl
Example
To copy *SENSOR_CONTROL sc into *SENSOR_CONTROL z:
z = sc.Copy()
- SensorControl.DetachComment(comment)¶
Detaches a comment from a *SENSOR_CONTROL
- Parameters:
comment (Comment) –
Comment
that will be detached from the *SENSOR_CONTROL- Returns:
No return value
- Return type:
None
Example
To detach comment c from the *SENSOR_CONTROL sc:
sc.DetachComment(c)
- SensorControl.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_CONTROL sc:
sc.Edit()
- SensorControl.Flagged(flag)¶
Checks if the *SENSOR_CONTROL is flagged or not
- Parameters:
flag (Flag) – Flag to test on the *SENSOR_CONTROL
- Returns:
True if flagged, False if not
- Return type:
bool
Example
To check if *SENSOR_CONTROL sc has flag f set on it:
if sc.Flagged(f): do_something..
- SensorControl.GetComments()¶
Extracts the comments associated to a *SENSOR_CONTROL
- 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_CONTROL sc:
comm_list = sc.GetComments()
- SensorControl.GetParameter(prop)¶
Checks if a SensorControl 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 theSensorControl.ViewParameters()
method and ‘method chaining’ (see the examples below)
- Parameters:
prop (string) – *SENSOR_CONTROL property to get parameter for
- Returns:
Parameter object if property is a parameter, None if not
- Return type:
dict
Example
To check if SensorControl property sc.example is a parameter:
Oasys.PRIMER.Options.property_parameter_names = True if sc.GetParameter(sc.example): do_something... Oasys.PRIMER.Options.property_parameter_names = FalseTo check if SensorControl property sc.example is a parameter by using the GetParameter method:
if sc.ViewParameters().GetParameter(sc.example): do_something..
- SensorControl.Keyword()¶
Returns the keyword for this *SENSOR_CONTROL. Note that a carriage return is not added. See also
SensorControl.KeywordCards()
- Returns:
string containing the keyword
- Return type:
str
Example
To get the keyword for SensorControl sc:
key = sc.Keyword()
- SensorControl.KeywordCards()¶
Returns the keyword cards for the *SENSOR_CONTROL. Note that a carriage return is not added. See also
SensorControl.Keyword()
- Returns:
string containing the cards
- Return type:
str
Example
To get the cards for sensor control sc:
cards = sc.KeywordCards()
- SensorControl.Next()¶
Returns the next *SENSOR_CONTROL in the model
- Returns:
SensorControl object (or None if there are no more *SENSOR_CONTROLs in the model)
- Return type:
SensorControl
Example
To get the *SENSOR_CONTROL in model m after *SENSOR_CONTROL sc:
sc = sc.Next()
- SensorControl.Previous()¶
Returns the previous *SENSOR_CONTROL in the model
- Returns:
SensorControl object (or None if there are no more *SENSOR_CONTROLs in the model)
- Return type:
SensorControl
Example
To get the *SENSOR_CONTROL in model m before *SENSOR_CONTROL sc:
sc = sc.Previous()
- SensorControl.SetFlag(flag)¶
Sets a flag on the *SENSOR_CONTROL
- Parameters:
flag (Flag) – Flag to set on the *SENSOR_CONTROL
- Returns:
No return value
- Return type:
None
Example
To set flag f for *SENSOR_CONTROL sc:
sc.SetFlag(f)
- SensorControl.Sketch(redraw=Oasys.gRPC.defaultArg)¶
Sketches the *SENSOR_CONTROL. The *SENSOR_CONTROL will be sketched until you either call
SensorControl.Unsketch()
,SensorControl.UnsketchAll()
,Model.UnsketchAll()
, or delete the model
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the *SENSOR_CONTROL is sketched. If omitted redraw is true. If you want to sketch several *SENSOR_CONTROLs and only redraw after the last one then use false for redraw and call
View.Redraw()
- Returns:
No return value
- Return type:
None
Example
To sketch *SENSOR_CONTROL sc:
sc.Sketch()
- SensorControl.Unsketch(redraw=Oasys.gRPC.defaultArg)¶
Unsketches the *SENSOR_CONTROL
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the *SENSOR_CONTROL is unsketched. If omitted redraw is true. If you want to unsketch several *SENSOR_CONTROLs and only redraw after the last one then use false for redraw and call
View.Redraw()
- Returns:
No return value
- Return type:
None
Example
To unsketch *SENSOR_CONTROL sc:
sc.Unsketch()
- SensorControl.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:
SensorControl object
- Return type:
dict
Example
To check if SensorControl property sc.example is a parameter by using the
SensorControl.GetParameter()
method:if sc.ViewParameters().GetParameter(sc.example): do_something..
- SensorControl.Xrefs()¶
Returns the cross references for this *SENSOR_CONTROL
- Returns:
Xrefs object
- Return type:
dict
Example
To get the cross references for *SENSOR_CONTROL sc:
xrefs = sc.Xrefs()