Oasys.PRIMER.TieBreak class¶
Properties¶
Constructor¶
Static methods¶
- classmethod TieBreak.BlankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the tie-breaks in the model
- Parameters:
model (Model) –
Model
that all tie-breaks will be blanked inredraw (boolean) – Optional. If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using
View.Redraw()
- Returns:
No return value
- Return type:
None
Example
To blank all of the tie-breaks in model m:
Oasys.PRIMER.TieBreak.BlankAll(m)
- classmethod TieBreak.BlankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the flagged tie-breaks in the model
- Parameters:
model (Model) –
Model
that all the flagged tie-breaks will be blanked inflag (Flag) – Flag set on the tie-breaks that you want to blank
redraw (boolean) – Optional. If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using
View.Redraw()
- Returns:
No return value
- Return type:
None
Example
To blank all of the tie-breaks in model m flagged with f:
Oasys.PRIMER.TieBreak.BlankFlagged(m, f)
- classmethod TieBreak.First(model)¶
Returns the first tie-break in the model
- Parameters:
model (Model) –
Model
to get first tie-break in- Returns:
TieBreak object (or None if there are no tie-breaks in the model)
- Return type:
TieBreak
Example
To get the first tie-break in model m:
tb = Oasys.PRIMER.TieBreak.First(m)
- classmethod TieBreak.FlagAll(model, flag)¶
Flags all of the tie-breaks in the model with a defined flag
- Parameters:
model (Model) –
Model
that all tie-breaks will be flagged inflag (Flag) – Flag to set on the tie-breaks
- Returns:
No return value
- Return type:
None
Example
To flag all of the tie-breaks with flag f in model m:
Oasys.PRIMER.TieBreak.FlagAll(m, f)
- classmethod TieBreak.GetAll(model)¶
Returns a list of TieBreak objects for all of the tie-breaks in a model in PRIMER
- Parameters:
model (Model) –
Model
to get tie-breaks from- Returns:
List of TieBreak objects
- Return type:
list
Example
To make a list of TieBreak objects for all of the tie-breaks in model m
tb = Oasys.PRIMER.TieBreak.GetAll(m)
- classmethod TieBreak.GetFlagged(model, flag)¶
Returns a list of TieBreak objects for all of the flagged tie-breaks in a model in PRIMER
- Parameters:
model (Model) –
Model
to get tie-breaks fromflag (Flag) – Flag set on the tie-breaks that you want to retrieve
- Returns:
List of TieBreak objects
- Return type:
list
Example
To make a list of TieBreak objects for all of the tie-breaks in model m flagged with f
tb = Oasys.PRIMER.TieBreak.GetFlagged(m, f)
- classmethod TieBreak.GetFromID(model, number)¶
Returns the TieBreak object for a tie-break ID
- Parameters:
model (Model) –
Model
to find the tie-break innumber (integer) – number of the tie-break you want the TieBreak object for
- Returns:
TieBreak object (or None if tie-break does not exist)
- Return type:
TieBreak
Example
To get the TieBreak object for tie-break 100 in model m
tb = Oasys.PRIMER.TieBreak.GetFromID(m, 100)
- classmethod TieBreak.Last(model)¶
Returns the last tie-break in the model
- Parameters:
model (Model) –
Model
to get last tie-break in- Returns:
TieBreak object (or None if there are no tie-breaks in the model)
- Return type:
TieBreak
Example
To get the last tie-break in model m:
tb = Oasys.PRIMER.TieBreak.Last(m)
- classmethod TieBreak.Pick(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)¶
Allows the user to pick a tie-break
- Parameters:
prompt (string) – Text to display as a prompt to the user
limit (Model or Flag) – Optional. If the argument is a
Model
then only tie-breaks from that model can be picked. If the argument is aFlag
then only tie-breaks that are flagged with limit can be selected. If omitted, or None, any tie-breaks from any model can be selected. from any modelmodal (boolean) – Optional. If picking is modal (blocks the user from doing anything else in PRIMER until this window is dismissed). If omitted the pick will be modal
button_text (string) – Optional. By default the window with the prompt will have a button labelled ‘Cancel’ which if pressed will cancel the pick and return None. If you want to change the text on the button use this argument. If omitted ‘Cancel’ will be used
- Returns:
TieBreak object (or None if not picked)
- Return type:
dict
Example
To pick a tie-break from model m giving the prompt ‘Pick tie-break from screen’:
tb = Oasys.PRIMER.TieBreak.Pick('Pick tie-break from screen', m)
- classmethod TieBreak.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)¶
Allows the user to select tie-breaks using standard PRIMER object menus
- Parameters:
flag (Flag) – Flag to use when selecting tie-breaks
prompt (string) – Text to display as a prompt to the user
limit (Model or Flag) – Optional. If the argument is a
Model
then only tie-breaks from that model can be selected. If the argument is aFlag
then only tie-breaks that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any tie-breaks 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 tie-breaks selected or None if menu cancelled
- Return type:
int
Example
To select tie-breaks from model m, flagging those selected with flag f, giving the prompt ‘Select tie-breaks’:
Oasys.PRIMER.TieBreak.Select(f, 'Select tie-breaks', m)To select tie-breaks, flagging those selected with flag f but limiting selection to tie-breaks flagged with flag l, giving the prompt ‘Select tie-breaks’:
Oasys.PRIMER.TieBreak.Select(f, 'Select tie-breaks', l)
- classmethod TieBreak.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Sketches all of the flagged tie-breaks in the model. The tie-breaks will be sketched until you either call
TieBreak.Unsketch()
,TieBreak.UnsketchFlagged()
,Model.UnsketchAll()
, or delete the model
- Parameters:
model (Model) –
Model
that all the flagged tie-breaks will be sketched inflag (Flag) – Flag set on the tie-breaks that you want to sketch
redraw (boolean) – Optional. If model should be redrawn or not after the tie-breaks are sketched. If omitted redraw is true. If you want to sketch flagged tie-breaks 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 tie-breaks flagged with flag in model m:
Oasys.PRIMER.TieBreak.SketchFlagged(m, flag)
- classmethod TieBreak.Total(model, exists=Oasys.gRPC.defaultArg)¶
Returns the total number of tie-breaks in the model
- Parameters:
model (Model) –
Model
to get total forexists (boolean) – Optional. true if only existing tie-breaks should be counted. If false or omitted referenced but undefined tie-breaks will also be included in the total
- Returns:
number of tie-breaks
- Return type:
int
Example
To get the total number of tie-breaks in model m:
total = Oasys.PRIMER.TieBreak.Total(m)
- classmethod TieBreak.UnblankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the tie-breaks in the model
- Parameters:
model (Model) –
Model
that all tie-breaks will be unblanked inredraw (boolean) – Optional. If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using
View.Redraw()
- Returns:
No return value
- Return type:
None
Example
To unblank all of the tie-breaks in model m:
Oasys.PRIMER.TieBreak.UnblankAll(m)
- classmethod TieBreak.UnblankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the flagged tie-breaks in the model
- Parameters:
model (Model) –
Model
that the flagged tie-breaks will be unblanked inflag (Flag) – Flag set on the tie-breaks that you want to unblank
redraw (boolean) – Optional. If model should be redrawn or not. If omitted redraw is false. If you want to do several (un)blanks and only redraw after the last one then use false for all redraws apart from the last one. Alternatively you can redraw using
View.Redraw()
- Returns:
No return value
- Return type:
None
Example
To unblank all of the tie-breaks in model m flagged with f:
Oasys.PRIMER.TieBreak.UnblankFlagged(m, f)
- classmethod TieBreak.UnflagAll(model, flag)¶
Unsets a defined flag on all of the tie-breaks in the model
- Parameters:
model (Model) –
Model
that the defined flag for all tie-breaks will be unset inflag (Flag) – Flag to unset on the tie-breaks
- Returns:
No return value
- Return type:
None
Example
To unset the flag f on all the tie-breaks in model m:
Oasys.PRIMER.TieBreak.UnflagAll(m, f)
- classmethod TieBreak.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all tie-breaks
- Parameters:
model (Model) –
Model
that all tie-breaks will be unblanked inredraw (boolean) – Optional. If model should be redrawn or not after the tie-breaks 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 tie-breaks in model m:
Oasys.PRIMER.TieBreak.UnsketchAll(m)
- classmethod TieBreak.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all flagged tie-breaks in the model
- Parameters:
model (Model) –
Model
that all tie-breaks will be unsketched inflag (Flag) – Flag set on the tie-breaks that you want to unsketch
redraw (boolean) – Optional. If model should be redrawn or not after the tie-breaks 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 tie-breaks flagged with flag in model m:
Oasys.PRIMER.TieBreak.UnsketchAll(m, flag)
Instance methods¶
- TieBreak.AssociateComment(comment)¶
Associates a comment with a tie-break
- Parameters:
comment (Comment) –
Comment
that will be attached to the tie-break- Returns:
No return value
- Return type:
None
Example
To associate comment c to the tie-break tb:
tb.AssociateComment(c)
- TieBreak.Blank()¶
Blanks the tie-break
- Returns:
No return value
- Return type:
None
Example
To blank tie-break tb:
tb.Blank()
- TieBreak.Blanked()¶
Checks if the tie-break is blanked or not
- Returns:
True if blanked, False if not
- Return type:
bool
Example
To check if tie-break tb is blanked:
if tb.Blanked(): do_something..
- TieBreak.ClearFlag(flag)¶
Clears a flag on the tie-break
- Parameters:
flag (Flag) – Flag to clear on the tie-break
- Returns:
No return value
- Return type:
None
Example
To clear flag f for tie-break tb:
tb.ClearFlag(f)
- TieBreak.Copy(range=Oasys.gRPC.defaultArg)¶
Copies the tie-break. The target include of the copied tie-break 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:
TieBreak object
- Return type:
TieBreak
Example
To copy tie-break tb into tie-break z:
z = tb.Copy()
- TieBreak.DetachComment(comment)¶
Detaches a comment from a tie-break
- Parameters:
comment (Comment) –
Comment
that will be detached from the tie-break- Returns:
No return value
- Return type:
None
Example
To detach comment c from the tie-break tb:
tb.DetachComment(c)
- TieBreak.Flagged(flag)¶
Checks if the tie-break is flagged or not
- Parameters:
flag (Flag) – Flag to test on the tie-break
- Returns:
True if flagged, False if not
- Return type:
bool
Example
To check if tie-break tb has flag f set on it:
if tb.Flagged(f): do_something..
- TieBreak.GetComments()¶
Extracts the comments associated to a tie-break
- 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 tie-break tb:
comm_list = tb.GetComments()
- TieBreak.GetParameter(prop)¶
Checks if a TieBreak 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 theTieBreak.ViewParameters()
method and ‘method chaining’ (see the examples below)
- Parameters:
prop (string) – tie-break property to get parameter for
- Returns:
Parameter object if property is a parameter, None if not
- Return type:
dict
Example
To check if TieBreak property tb.example is a parameter:
Oasys.PRIMER.Options.property_parameter_names = True if tb.GetParameter(tb.example): do_something... Oasys.PRIMER.Options.property_parameter_names = FalseTo check if TieBreak property tb.example is a parameter by using the GetParameter method:
if tb.ViewParameters().GetParameter(tb.example): do_something..
- TieBreak.Keyword()¶
Returns the keyword for this tie-break (**CONSTRAINED_TIE_BREAK). Note that a carriage return is not added. See also
TieBreak.KeywordCards()
- Returns:
string containing the keyword
- Return type:
str
Example
To get the keyword for tie-break tb:
key = tb.Keyword()
- TieBreak.KeywordCards()¶
Returns the keyword cards for the tie-break. Note that a carriage return is not added. See also
TieBreak.Keyword()
- Returns:
string containing the cards
- Return type:
str
Example
To get the cards for tie-break tb:
cards = tb.KeywordCards()
- TieBreak.Next()¶
Returns the next tie-break in the model
- Returns:
TieBreak object (or None if there are no more tie-breaks in the model)
- Return type:
TieBreak
Example
To get the tie-break in model m after tie-break tb:
tb = tb.Next()
- TieBreak.Previous()¶
Returns the previous tie-break in the model
- Returns:
TieBreak object (or None if there are no more tie-breaks in the model)
- Return type:
TieBreak
Example
To get the tie-break in model m before tie-break tb:
tb = tb.Previous()
- TieBreak.SetFlag(flag)¶
Sets a flag on the tie-break
- Parameters:
flag (Flag) – Flag to set on the tie-break
- Returns:
No return value
- Return type:
None
Example
To set flag f for tie-break tb:
tb.SetFlag(f)
- TieBreak.Sketch(redraw=Oasys.gRPC.defaultArg)¶
Sketches the tie-break. The tie-break will be sketched until you either call
TieBreak.Unsketch()
,TieBreak.UnsketchAll()
,Model.UnsketchAll()
, or delete the model
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the tie-break is sketched. If omitted redraw is true. If you want to sketch several tie-breaks 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 tie-break tb:
tb.Sketch()
- TieBreak.Unblank()¶
Unblanks the tie-break
- Returns:
No return value
- Return type:
None
Example
To unblank tie-break tb:
tb.Unblank()
- TieBreak.Unsketch(redraw=Oasys.gRPC.defaultArg)¶
Unsketches the tie-break
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the tie-break is unsketched. If omitted redraw is true. If you want to unsketch several tie-breaks 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 tie-break tb:
tb.Unsketch()
- TieBreak.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:
TieBreak object
- Return type:
dict
Example
To check if TieBreak property tb.example is a parameter by using the
TieBreak.GetParameter()
method:if tb.ViewParameters().GetParameter(tb.example): do_something..
- TieBreak.Xrefs()¶
Returns the cross references for this tie-break
- Returns:
Xrefs object
- Return type:
dict
Example
To get the cross references for tie-break tb:
xrefs = tb.Xrefs()