Oasys.PRIMER.InterfaceComponent class¶
Constants¶
Properties¶
- property InterfaceComponent.cid: integer¶
Coordinate system ID
- property InterfaceComponent.exists(read only): boolean¶
true if interface component exists, false if referred to but not defined
- property InterfaceComponent.include: integer¶
The
Include
file number that the interface component is in
- property InterfaceComponent.model(read only): integer¶
The
Model
number that the interface component is in
- property InterfaceComponent.nid: integer¶
Node ID
- property InterfaceComponent.nsid: integer¶
Element ID or element set ID. The
ssid
property is an alternative name for this
- property InterfaceComponent.option: constant¶
InterfaceComponent
option. Can beInterfaceComponent.NODE
,InterfaceComponent.SEGMENT
,
- property InterfaceComponent.ssid: integer¶
Element ID or element set ID. The
nsid
property is an alternative name for this
- property InterfaceComponent.title: string¶
InterfaceComponent
title
Constructor¶
- classmethod InterfaceComponent(model, type, snid_ssid, cid, nid, label=Oasys.gRPC.defaultArg, title=Oasys.gRPC.defaultArg)¶
Create a new
InterfaceComponent
object
- Parameters:
model (Model) –
Model
that InterfaceComponent will be created intype (constant) –
InterfaceComponent
type. Can beInterfaceComponent.NODE
,InterfaceComponent.SEGMENT
,snid_ssid (integer) – Set node or set segment ID
cid (integer) – Coordinate system ID
nid (integer) – Node ID
label (integer) – Optional.
InterfaceComponent
numbertitle (string) – Optional. Title for this interface
- Returns:
InterfaceComponent object
- Return type:
dict
Example
To create a new Interface Component in model m with option: NODE, nsid: 100, cyd: 200, nid: 300, ID: 1, title: “MyInterfaceComponent”
i_c = Oasys.PRIMER.InterfaceComponent(m, Oasys.PRIMER.InterfaceComponent.NODE, 100, 200, 300, 1, MyInterfaceComponent)
Static methods¶
- classmethod InterfaceComponent.Create(model, modal=Oasys.gRPC.defaultArg)¶
Starts an interactive editing panel to create an InterfaceComponent
- Parameters:
model (Model) –
Model
that the InterfaceComponent 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:
InterfaceComponent object (or None if not made)
- Return type:
dict
Example
To start creating an InterfaceComponent in model m:
ed = Oasys.PRIMER.InterfaceComponent.Create(m)
- classmethod InterfaceComponent.First(model)¶
Returns the first interface component in the model
- Parameters:
model (Model) –
Model
to get first interface component in- Returns:
InterfaceComponent object (or None if there are no interface components in the model)
- Return type:
InterfaceComponent
Example
To get the first interface component in model m:
i_c = Oasys.PRIMER.InterfaceComponent.First(m)
- classmethod InterfaceComponent.FirstFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the first free interface component label in the model. Also see
InterfaceComponent.LastFreeLabel()
,InterfaceComponent.NextFreeLabel()
andModel.FirstFreeItemLabel()
- Parameters:
model (Model) –
Model
to get first free interface component label inlayer (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:
InterfaceComponent label
- Return type:
int
Example
To get the first free interface component label in model m:
label = Oasys.PRIMER.InterfaceComponent.FirstFreeLabel(m)
- classmethod InterfaceComponent.FlagAll(model, flag)¶
Flags all of the interface components in the model with a defined flag
- Parameters:
model (Model) –
Model
that all interface components will be flagged inflag (Flag) – Flag to set on the interface components
- Returns:
No return value
- Return type:
None
Example
To flag all of the interface components with flag f in model m:
Oasys.PRIMER.InterfaceComponent.FlagAll(m, f)
- classmethod InterfaceComponent.GetAll(model)¶
Returns a list of InterfaceComponent objects for all of the interface components in a model in PRIMER
- Parameters:
model (Model) –
Model
to get interface components from- Returns:
List of InterfaceComponent objects
- Return type:
list
Example
To make a list of InterfaceComponent objects for all of the interface components in model m
i_c = Oasys.PRIMER.InterfaceComponent.GetAll(m)
- classmethod InterfaceComponent.GetFlagged(model, flag)¶
Returns a list of InterfaceComponent objects for all of the flagged interface components in a model in PRIMER
- Parameters:
model (Model) –
Model
to get interface components fromflag (Flag) – Flag set on the interface components that you want to retrieve
- Returns:
List of InterfaceComponent objects
- Return type:
list
Example
To make a list of InterfaceComponent objects for all of the interface components in model m flagged with f
i_c = Oasys.PRIMER.InterfaceComponent.GetFlagged(m, f)
- classmethod InterfaceComponent.GetFromID(model, number)¶
Returns the InterfaceComponent object for a interface component ID
- Parameters:
model (Model) –
Model
to find the interface component innumber (integer) – number of the interface component you want the InterfaceComponent object for
- Returns:
InterfaceComponent object (or None if interface component does not exist)
- Return type:
InterfaceComponent
Example
To get the InterfaceComponent object for interface component 100 in model m
i_c = Oasys.PRIMER.InterfaceComponent.GetFromID(m, 100)
- classmethod InterfaceComponent.Last(model)¶
Returns the last interface component in the model
- Parameters:
model (Model) –
Model
to get last interface component in- Returns:
InterfaceComponent object (or None if there are no interface components in the model)
- Return type:
InterfaceComponent
Example
To get the last interface component in model m:
i_c = Oasys.PRIMER.InterfaceComponent.Last(m)
- classmethod InterfaceComponent.LastFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the last free interface component label in the model. Also see
InterfaceComponent.FirstFreeLabel()
,InterfaceComponent.NextFreeLabel()
and seeModel.LastFreeItemLabel()
- Parameters:
- Returns:
InterfaceComponent label
- Return type:
int
Example
To get the last free interface component label in model m:
label = Oasys.PRIMER.InterfaceComponent.LastFreeLabel(m)
- classmethod InterfaceComponent.NextFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the next free (highest+1) interface component label in the model. Also see
InterfaceComponent.FirstFreeLabel()
,InterfaceComponent.LastFreeLabel()
andModel.NextFreeItemLabel()
- Parameters:
- Returns:
InterfaceComponent label
- Return type:
int
Example
To get the next free interface component label in model m:
label = Oasys.PRIMER.InterfaceComponent.NextFreeLabel(m)
- classmethod InterfaceComponent.RenumberAll(model, start)¶
Renumbers all of the interface components in the model
- Parameters:
model (Model) –
Model
that all interface components will be renumbered instart (integer) – Start point for renumbering
- Returns:
No return value
- Return type:
None
Example
To renumber all of the interface components in model m, from 1000000:
Oasys.PRIMER.InterfaceComponent.RenumberAll(m, 1000000)
- classmethod InterfaceComponent.RenumberFlagged(model, flag, start)¶
Renumbers all of the flagged interface components in the model
- Parameters:
model (Model) –
Model
that all the flagged interface components will be renumbered inflag (Flag) – Flag set on the interface components that you want to renumber
start (integer) – Start point for renumbering
- Returns:
No return value
- Return type:
None
Example
To renumber all of the interface components in model m flagged with f, from 1000000:
Oasys.PRIMER.InterfaceComponent.RenumberFlagged(m, f, 1000000)
- classmethod InterfaceComponent.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)¶
Allows the user to select interface components using standard PRIMER object menus
- Parameters:
flag (Flag) – Flag to use when selecting interface components
prompt (string) – Text to display as a prompt to the user
limit (Model or Flag) – Optional. If the argument is a
Model
then only interface components from that model can be selected. If the argument is aFlag
then only interface components that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any interface components 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 interface components selected or None if menu cancelled
- Return type:
int
Example
To select interface components from model m, flagging those selected with flag f, giving the prompt ‘Select interface components’:
Oasys.PRIMER.InterfaceComponent.Select(f, 'Select interface components', m)To select interface components, flagging those selected with flag f but limiting selection to interface components flagged with flag l, giving the prompt ‘Select interface components’:
Oasys.PRIMER.InterfaceComponent.Select(f, 'Select interface components', l)
- classmethod InterfaceComponent.Total(model, exists=Oasys.gRPC.defaultArg)¶
Returns the total number of interface components in the model
- Parameters:
model (Model) –
Model
to get total forexists (boolean) – Optional. true if only existing interface components should be counted. If false or omitted referenced but undefined interface components will also be included in the total
- Returns:
number of interface components
- Return type:
int
Example
To get the total number of interface components in model m:
total = Oasys.PRIMER.InterfaceComponent.Total(m)
- classmethod InterfaceComponent.UnflagAll(model, flag)¶
Unsets a defined flag on all of the interface components in the model
- Parameters:
model (Model) –
Model
that the defined flag for all interface components will be unset inflag (Flag) – Flag to unset on the interface components
- Returns:
No return value
- Return type:
None
Example
To unset the flag f on all the interface components in model m:
Oasys.PRIMER.InterfaceComponent.UnflagAll(m, f)
Instance methods¶
- InterfaceComponent.AssociateComment(comment)¶
Associates a comment with a interface component
- Parameters:
comment (Comment) –
Comment
that will be attached to the interface component- Returns:
No return value
- Return type:
None
Example
To associate comment c to the interface component i_c:
i_c.AssociateComment(c)
- InterfaceComponent.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 interface component i_c:
i_c.Browse()
- InterfaceComponent.ClearFlag(flag)¶
Clears a flag on the interface component
- Parameters:
flag (Flag) – Flag to clear on the interface component
- Returns:
No return value
- Return type:
None
Example
To clear flag f for interface component i_c:
i_c.ClearFlag(f)
- InterfaceComponent.Copy(range=Oasys.gRPC.defaultArg)¶
Copies the interface component. The target include of the copied interface component 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:
InterfaceComponent object
- Return type:
InterfaceComponent
Example
To copy interface component i_c into interface component z:
z = i_c.Copy()
- InterfaceComponent.DetachComment(comment)¶
Detaches a comment from a interface component
- Parameters:
comment (Comment) –
Comment
that will be detached from the interface component- Returns:
No return value
- Return type:
None
Example
To detach comment c from the interface component i_c:
i_c.DetachComment(c)
- InterfaceComponent.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 interface component i_c:
i_c.Edit()
- InterfaceComponent.Flagged(flag)¶
Checks if the interface component is flagged or not
- Parameters:
flag (Flag) – Flag to test on the interface component
- Returns:
True if flagged, False if not
- Return type:
bool
Example
To check if interface component i_c has flag f set on it:
if i_c.Flagged(f): do_something..
- InterfaceComponent.GetComments()¶
Extracts the comments associated to a interface component
- 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 interface component i_c:
comm_list = i_c.GetComments()
- InterfaceComponent.GetParameter(prop)¶
Checks if a InterfaceComponent 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 theInterfaceComponent.ViewParameters()
method and ‘method chaining’ (see the examples below)
- Parameters:
prop (string) – interface component property to get parameter for
- Returns:
Parameter object if property is a parameter, None if not
- Return type:
dict
Example
To check if InterfaceComponent property i_c.example is a parameter:
Oasys.PRIMER.Options.property_parameter_names = True if i_c.GetParameter(i_c.example): do_something... Oasys.PRIMER.Options.property_parameter_names = FalseTo check if InterfaceComponent property i_c.example is a parameter by using the GetParameter method:
if i_c.ViewParameters().GetParameter(i_c.example): do_something..
- InterfaceComponent.Keyword()¶
Returns the keyword for this InterfaceComponent (*INTERFACE_COMPONENT). Note that a carriage return is not added. See also
InterfaceComponent.KeywordCards()
- Returns:
string containing the keyword
- Return type:
str
Example
To get the keyword for InterfaceComponent ed:
key = ed.Keyword()
- InterfaceComponent.KeywordCards()¶
Returns the keyword cards for the InterfaceComponent. Note that a carriage return is not added. See also
InterfaceComponent.Keyword()
- Returns:
string containing the cards
- Return type:
str
Example
To get the cards for InterfaceComponent ed:
cards = ed.KeywordCards()
- InterfaceComponent.Next()¶
Returns the next interface component in the model
- Returns:
InterfaceComponent object (or None if there are no more interface components in the model)
- Return type:
InterfaceComponent
Example
To get the interface component in model m after interface component i_c:
i_c = i_c.Next()
- InterfaceComponent.Previous()¶
Returns the previous interface component in the model
- Returns:
InterfaceComponent object (or None if there are no more interface components in the model)
- Return type:
InterfaceComponent
Example
To get the interface component in model m before interface component i_c:
i_c = i_c.Previous()
- InterfaceComponent.SetFlag(flag)¶
Sets a flag on the interface component
- Parameters:
flag (Flag) – Flag to set on the interface component
- Returns:
No return value
- Return type:
None
Example
To set flag f for interface component i_c:
i_c.SetFlag(f)
- InterfaceComponent.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:
InterfaceComponent object
- Return type:
dict
Example
To check if InterfaceComponent property i_c.example is a parameter by using the
InterfaceComponent.GetParameter()
method:if i_c.ViewParameters().GetParameter(i_c.example): do_something..
- InterfaceComponent.Xrefs()¶
Returns the cross references for this interface component
- Returns:
Xrefs object
- Return type:
dict
Example
To get the cross references for interface component i_c:
xrefs = i_c.Xrefs()