Oasys.PRIMER.ReferenceGeometry class¶
Properties¶
- property ReferenceGeometry.aid: integer¶
ReferenceGeometry
number. Also see thelabel
property which is an alternative name for this
- property ReferenceGeometry.birth: boolean¶
Turns _BIRTH on or off
- property ReferenceGeometry.birth_time: float¶
Birth time
- property ReferenceGeometry.exists(read only): boolean¶
true if airbag reference geometry exists, false if referred to but not defined
- property ReferenceGeometry.id: boolean¶
Turns _ID on or OFF
- property ReferenceGeometry.include: integer¶
The
Include
file number that the airbag reference geometry is in
- property ReferenceGeometry.label: integer¶
ReferenceGeometry
number. Also see theaid
property which is an alternative name for this
- property ReferenceGeometry.model(read only): integer¶
The
Model
number that the airbag reference geometry is in
- property ReferenceGeometry.rdt: boolean¶
Turns _RDT on or OFF
- property ReferenceGeometry.sx: float¶
Scale factor in X direction
- property ReferenceGeometry.sy: float¶
Scale factor in Y direction
- property ReferenceGeometry.sz: float¶
Scale factor in Z direction
Constructor¶
- classmethod ReferenceGeometry(model, aid=Oasys.gRPC.defaultArg)¶
Create a new
ReferenceGeometry
object
- Parameters:
model (Model) –
Model
that ReferenceGeometry will be created inaid (integer) – Optional.
ReferenceGeometry
number to set _ID suffix- Returns:
ReferenceGeometry object
- Return type:
dict
Example
To create a new ReferenceGeometry in model m
a = Oasys.PRIMER.ReferenceGeometry(m)
Static methods¶
- classmethod ReferenceGeometry.Create(model, modal=Oasys.gRPC.defaultArg)¶
Starts an interactive editing panel to create an ardt
- Parameters:
model (Model) –
Model
that the ardt 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:
ReferenceGeometry object (or None if not made)
- Return type:
dict
Example
To start creating an ardt in model m:
m = Oasys.PRIMER.ReferenceGeometry.Create(m)
- classmethod ReferenceGeometry.First(model)¶
Returns the first airbag reference geometry in the model
- Parameters:
model (Model) –
Model
to get first airbag reference geometry in- Returns:
ReferenceGeometry object (or None if there are no airbag reference geometrys in the model)
- Return type:
ReferenceGeometry
Example
To get the first airbag reference geometry in model m:
a = Oasys.PRIMER.ReferenceGeometry.First(m)
- classmethod ReferenceGeometry.FirstFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the first free airbag reference geometry label in the model. Also see
ReferenceGeometry.LastFreeLabel()
,ReferenceGeometry.NextFreeLabel()
andModel.FirstFreeItemLabel()
- Parameters:
model (Model) –
Model
to get first free airbag reference geometry 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:
ReferenceGeometry label
- Return type:
int
Example
To get the first free airbag reference geometry label in model m:
label = Oasys.PRIMER.ReferenceGeometry.FirstFreeLabel(m)
- classmethod ReferenceGeometry.FlagAll(model, flag)¶
Flags all of the airbag reference geometrys in the model with a defined flag
- Parameters:
model (Model) –
Model
that all airbag reference geometrys will be flagged inflag (Flag) – Flag to set on the airbag reference geometrys
- Returns:
No return value
- Return type:
None
Example
To flag all of the airbag reference geometrys with flag f in model m:
Oasys.PRIMER.ReferenceGeometry.FlagAll(m, f)
- classmethod ReferenceGeometry.GetAll(model)¶
Returns a list of ReferenceGeometry objects for all of the airbag reference geometrys in a model in PRIMER
- Parameters:
model (Model) –
Model
to get airbag reference geometrys from- Returns:
List of ReferenceGeometry objects
- Return type:
list
Example
To make a list of ReferenceGeometry objects for all of the airbag reference geometrys in model m
a = Oasys.PRIMER.ReferenceGeometry.GetAll(m)
- classmethod ReferenceGeometry.GetFlagged(model, flag)¶
Returns a list of ReferenceGeometry objects for all of the flagged airbag reference geometrys in a model in PRIMER
- Parameters:
model (Model) –
Model
to get airbag reference geometrys fromflag (Flag) – Flag set on the airbag reference geometrys that you want to retrieve
- Returns:
List of ReferenceGeometry objects
- Return type:
list
Example
To make a list of ReferenceGeometry objects for all of the airbag reference geometrys in model m flagged with f
a = Oasys.PRIMER.ReferenceGeometry.GetFlagged(m, f)
- classmethod ReferenceGeometry.GetFromID(model, number)¶
Returns the ReferenceGeometry object for a airbag reference geometry ID
- Parameters:
model (Model) –
Model
to find the airbag reference geometry innumber (integer) – number of the airbag reference geometry you want the ReferenceGeometry object for
- Returns:
ReferenceGeometry object (or None if airbag reference geometry does not exist)
- Return type:
ReferenceGeometry
Example
To get the ReferenceGeometry object for airbag reference geometry 100 in model m
a = Oasys.PRIMER.ReferenceGeometry.GetFromID(m, 100)
- classmethod ReferenceGeometry.Last(model)¶
Returns the last airbag reference geometry in the model
- Parameters:
model (Model) –
Model
to get last airbag reference geometry in- Returns:
ReferenceGeometry object (or None if there are no airbag reference geometrys in the model)
- Return type:
ReferenceGeometry
Example
To get the last airbag reference geometry in model m:
a = Oasys.PRIMER.ReferenceGeometry.Last(m)
- classmethod ReferenceGeometry.LastFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the last free airbag reference geometry label in the model. Also see
ReferenceGeometry.FirstFreeLabel()
,ReferenceGeometry.NextFreeLabel()
and seeModel.LastFreeItemLabel()
- Parameters:
- Returns:
ReferenceGeometry label
- Return type:
int
Example
To get the last free airbag reference geometry label in model m:
label = Oasys.PRIMER.ReferenceGeometry.LastFreeLabel(m)
- classmethod ReferenceGeometry.NextFreeLabel(model, layer=Oasys.gRPC.defaultArg)¶
Returns the next free (highest+1) airbag reference geometry label in the model. Also see
ReferenceGeometry.FirstFreeLabel()
,ReferenceGeometry.LastFreeLabel()
andModel.NextFreeItemLabel()
- Parameters:
model (Model) –
Model
to get next free airbag reference geometry label inlayer (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:
ReferenceGeometry label
- Return type:
int
Example
To get the next free airbag reference geometry label in model m:
label = Oasys.PRIMER.ReferenceGeometry.NextFreeLabel(m)
- classmethod ReferenceGeometry.Pick(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)¶
Allows the user to pick a airbag reference geometry
- 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 airbag reference geometrys from that model can be picked. If the argument is aFlag
then only airbag reference geometrys that are flagged with limit can be selected. If omitted, or None, any airbag reference geometrys 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:
ReferenceGeometry object (or None if not picked)
- Return type:
dict
Example
To pick a airbag reference geometry from model m giving the prompt ‘Pick airbag reference geometry from screen’:
a = Oasys.PRIMER.ReferenceGeometry.Pick('Pick airbag reference geometry from screen', m)
- classmethod ReferenceGeometry.RenumberAll(model, start)¶
Renumbers all of the airbag reference geometrys in the model
- Parameters:
model (Model) –
Model
that all airbag reference geometrys will be renumbered instart (integer) – Start point for renumbering
- Returns:
No return value
- Return type:
None
Example
To renumber all of the airbag reference geometrys in model m, from 1000000:
Oasys.PRIMER.ReferenceGeometry.RenumberAll(m, 1000000)
- classmethod ReferenceGeometry.RenumberFlagged(model, flag, start)¶
Renumbers all of the flagged airbag reference geometrys in the model
- Parameters:
model (Model) –
Model
that all the flagged airbag reference geometrys will be renumbered inflag (Flag) – Flag set on the airbag reference geometrys that you want to renumber
start (integer) – Start point for renumbering
- Returns:
No return value
- Return type:
None
Example
To renumber all of the airbag reference geometrys in model m flagged with f, from 1000000:
Oasys.PRIMER.ReferenceGeometry.RenumberFlagged(m, f, 1000000)
- classmethod ReferenceGeometry.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)¶
Allows the user to select airbag reference geometrys using standard PRIMER object menus
- Parameters:
flag (Flag) – Flag to use when selecting airbag reference geometrys
prompt (string) – Text to display as a prompt to the user
limit (Model or Flag) – Optional. If the argument is a
Model
then only airbag reference geometrys from that model can be selected. If the argument is aFlag
then only airbag reference geometrys that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any airbag reference geometrys 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 airbag reference geometrys selected or None if menu cancelled
- Return type:
int
Example
To select airbag reference geometrys from model m, flagging those selected with flag f, giving the prompt ‘Select airbag reference geometrys’:
Oasys.PRIMER.ReferenceGeometry.Select(f, 'Select airbag reference geometrys', m)To select airbag reference geometrys, flagging those selected with flag f but limiting selection to airbag reference geometrys flagged with flag l, giving the prompt ‘Select airbag reference geometrys’:
Oasys.PRIMER.ReferenceGeometry.Select(f, 'Select airbag reference geometrys', l)
- classmethod ReferenceGeometry.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Sketches all of the flagged airbag reference geometrys in the model. The airbag reference geometrys will be sketched until you either call
ReferenceGeometry.Unsketch()
,ReferenceGeometry.UnsketchFlagged()
,Model.UnsketchAll()
, or delete the model
- Parameters:
model (Model) –
Model
that all the flagged airbag reference geometrys will be sketched inflag (Flag) – Flag set on the airbag reference geometrys that you want to sketch
redraw (boolean) – Optional. If model should be redrawn or not after the airbag reference geometrys are sketched. If omitted redraw is true. If you want to sketch flagged airbag reference geometrys 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 airbag reference geometrys flagged with flag in model m:
Oasys.PRIMER.ReferenceGeometry.SketchFlagged(m, flag)
- classmethod ReferenceGeometry.Total(model, exists=Oasys.gRPC.defaultArg)¶
Returns the total number of airbag reference geometrys in the model
- Parameters:
model (Model) –
Model
to get total forexists (boolean) – Optional. true if only existing airbag reference geometrys should be counted. If false or omitted referenced but undefined airbag reference geometrys will also be included in the total
- Returns:
number of airbag reference geometrys
- Return type:
int
Example
To get the total number of airbag reference geometrys in model m:
total = Oasys.PRIMER.ReferenceGeometry.Total(m)
- classmethod ReferenceGeometry.UnflagAll(model, flag)¶
Unsets a defined flag on all of the airbag reference geometrys in the model
- Parameters:
model (Model) –
Model
that the defined flag for all airbag reference geometrys will be unset inflag (Flag) – Flag to unset on the airbag reference geometrys
- Returns:
No return value
- Return type:
None
Example
To unset the flag f on all the airbag reference geometrys in model m:
Oasys.PRIMER.ReferenceGeometry.UnflagAll(m, f)
- classmethod ReferenceGeometry.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all airbag reference geometrys
- Parameters:
model (Model) –
Model
that all airbag reference geometrys will be unblanked inredraw (boolean) – Optional. If model should be redrawn or not after the airbag reference geometrys 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 airbag reference geometrys in model m:
Oasys.PRIMER.ReferenceGeometry.UnsketchAll(m)
- classmethod ReferenceGeometry.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all flagged airbag reference geometrys in the model
- Parameters:
model (Model) –
Model
that all airbag reference geometrys will be unsketched inflag (Flag) – Flag set on the airbag reference geometrys that you want to unsketch
redraw (boolean) – Optional. If model should be redrawn or not after the airbag reference geometrys 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 airbag reference geometrys flagged with flag in model m:
Oasys.PRIMER.ReferenceGeometry.UnsketchAll(m, flag)
Instance methods¶
- ReferenceGeometry.AssociateComment(comment)¶
Associates a comment with a airbag reference geometry
- Parameters:
comment (Comment) –
Comment
that will be attached to the airbag reference geometry- Returns:
No return value
- Return type:
None
Example
To associate comment c to the airbag reference geometry a:
a.AssociateComment(c)
- ReferenceGeometry.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 airbag reference geometry a:
a.Browse()
- ReferenceGeometry.ClearFlag(flag)¶
Clears a flag on the airbag reference geometry
- Parameters:
flag (Flag) – Flag to clear on the airbag reference geometry
- Returns:
No return value
- Return type:
None
Example
To clear flag f for airbag reference geometry a:
a.ClearFlag(f)
- ReferenceGeometry.Copy(range=Oasys.gRPC.defaultArg)¶
Copies the airbag reference geometry. The target include of the copied airbag reference geometry 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:
ReferenceGeometry object
- Return type:
ReferenceGeometry
Example
To copy airbag reference geometry a into airbag reference geometry z:
z = a.Copy()
- ReferenceGeometry.DetachComment(comment)¶
Detaches a comment from a airbag reference geometry
- Parameters:
comment (Comment) –
Comment
that will be detached from the airbag reference geometry- Returns:
No return value
- Return type:
None
Example
To detach comment c from the airbag reference geometry a:
a.DetachComment(c)
- ReferenceGeometry.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 airbag reference geometry a:
a.Edit()
- ReferenceGeometry.Flagged(flag)¶
Checks if the airbag reference geometry is flagged or not
- Parameters:
flag (Flag) – Flag to test on the airbag reference geometry
- Returns:
True if flagged, False if not
- Return type:
bool
Example
To check if airbag reference geometry a has flag f set on it:
if a.Flagged(f): do_something..
- ReferenceGeometry.GetComments()¶
Extracts the comments associated to a airbag reference geometry
- 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 airbag reference geometry a:
comm_list = a.GetComments()
- ReferenceGeometry.GetNode(nid)¶
Returns the reference geometry coordinates for the node
- Parameters:
nid (integer) – Node ID
- Returns:
A list containing the three reference coordinates (or None if the node is not on the reference geometry)
- Return type:
list
Example
To get the reference coordinates of node number nid on reference geometry a
coords = a.GetNode(nid)
- ReferenceGeometry.GetParameter(prop)¶
Checks if a ReferenceGeometry 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 theReferenceGeometry.ViewParameters()
method and ‘method chaining’ (see the examples below)
- Parameters:
prop (string) – airbag reference geometry property to get parameter for
- Returns:
Parameter object if property is a parameter, None if not
- Return type:
dict
Example
To check if ReferenceGeometry property a.example is a parameter:
Oasys.PRIMER.Options.property_parameter_names = True if a.GetParameter(a.example): do_something... Oasys.PRIMER.Options.property_parameter_names = FalseTo check if ReferenceGeometry property a.example is a parameter by using the GetParameter method:
if a.ViewParameters().GetParameter(a.example): do_something..
- ReferenceGeometry.Keyword()¶
Returns the keyword for this reference_geometry (*AIRBAG_REFERENCE_GEOMETRY). Note that a carriage return is not added. See also
ReferenceGeometry.KeywordCards()
- Returns:
string containing the keyword
- Return type:
str
Example
To get the keyword for reference_geometry m:
key = m.Keyword()
- ReferenceGeometry.KeywordCards()¶
Returns the keyword cards for the reference_geometry. Note that a carriage return is not added. See also
ReferenceGeometry.Keyword()
- Returns:
string containing the cards
- Return type:
str
Example
To get the cards for airbag reference geometry a:
cards = b.KeywordCards()
- ReferenceGeometry.Next()¶
Returns the next airbag reference geometry in the model
- Returns:
ReferenceGeometry object (or None if there are no more airbag reference geometrys in the model)
- Return type:
ReferenceGeometry
Example
To get the airbag reference geometry in model m after airbag reference geometry a:
a = a.Next()
- ReferenceGeometry.Previous()¶
Returns the previous airbag reference geometry in the model
- Returns:
ReferenceGeometry object (or None if there are no more airbag reference geometrys in the model)
- Return type:
ReferenceGeometry
Example
To get the airbag reference geometry in model m before airbag reference geometry a:
a = a.Previous()
- ReferenceGeometry.RemoveNode(nid)¶
Removes a node from the reference geometry if it is on it
- Parameters:
nid (integer) – Node ID
- Returns:
No return value
- Return type:
None
Example
To remove node 11 from reference geometry a:
a.RemoveNode(11)
- ReferenceGeometry.SetFlag(flag)¶
Sets a flag on the airbag reference geometry
- Parameters:
flag (Flag) – Flag to set on the airbag reference geometry
- Returns:
No return value
- Return type:
None
Example
To set flag f for airbag reference geometry a:
a.SetFlag(f)
- ReferenceGeometry.SetNode(nid, x, y, z)¶
Adds a node to the reference geometry if not already there, otherwise just changes the coordinates
- Parameters:
nid (integer) – Node ID
x (real) – X reference coordinate
y (real) – Y reference coordinate
z (real) – Z reference coordinate
- Returns:
No return value
- Return type:
None
Example
To add node 11 to reference geometry a with coordinates 12.0, 13.0, 14.0
a.SetNode(11, 12.0, 13.0, 14.0)
- ReferenceGeometry.Sketch(redraw=Oasys.gRPC.defaultArg)¶
Sketches the airbag reference geometry. The airbag reference geometry will be sketched until you either call
ReferenceGeometry.Unsketch()
,ReferenceGeometry.UnsketchAll()
,Model.UnsketchAll()
, or delete the model
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the airbag reference geometry is sketched. If omitted redraw is true. If you want to sketch several airbag reference geometrys 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 airbag reference geometry a:
a.Sketch()
- ReferenceGeometry.Spool()¶
Spools a reference geometry, entry by entry. See also
ReferenceGeometry.StartSpool
- Returns:
A list containing the node ID and the three coordinates. Returns 0 if no more items
- Return type:
list
Example
To spool reference geometry a:
a.StartSpool() while mylist := a.Spool(): do something..
- ReferenceGeometry.StartSpool()¶
Starts a reference geometry spooling operation. See also
ReferenceGeometry.Spool
- Returns:
No return value
- Return type:
None
Example
To start spooling reference geometry a:
a.StartSpool()
- ReferenceGeometry.Unsketch(redraw=Oasys.gRPC.defaultArg)¶
Unsketches the airbag reference geometry
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the airbag reference geometry is unsketched. If omitted redraw is true. If you want to unsketch several airbag reference geometrys 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 airbag reference geometry a:
a.Unsketch()
- ReferenceGeometry.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:
ReferenceGeometry object
- Return type:
dict
Example
To check if ReferenceGeometry property a.example is a parameter by using the
ReferenceGeometry.GetParameter()
method:if a.ViewParameters().GetParameter(a.example): do_something..
- ReferenceGeometry.Xrefs()¶
Returns the cross references for this airbag reference geometry
- Returns:
Xrefs object
- Return type:
dict
Example
To get the cross references for airbag reference geometry a:
xrefs = a.Xrefs()