Oasys.PRIMER.Velocity class¶
Properties¶
- property Velocity.boxid: integer¶
Define box containing nodes
- property Velocity.exists(read only): boolean¶
true if velocity exists, false if referred to but not defined
- property Velocity.icid: integer¶
Local coordinate system
- property Velocity.irigid: integer¶
IRIGID flag
- property Velocity.vx: float¶
Initial velocity in X direction
- property Velocity.vxe: float¶
Initial velocity in X direction of exempted nodes
- property Velocity.vxr: float¶
Initial rotational velocity about X axis
- property Velocity.vxre: float¶
Initial rotational velocity about X axis of exempted nodes
- property Velocity.vy: float¶
Initial velocity in Y direction
- property Velocity.vye: float¶
Initial velocity in Y direction of exempted nodes
- property Velocity.vyr: float¶
Initial rotational velocity about Y axis
- property Velocity.vyre: float¶
Initial rotational velocity about Y axis of exempted nodes
- property Velocity.vz: float¶
Initial velocity in Z direction
- property Velocity.vze: float¶
Initial velocity in Z direction of exempted nodes
- property Velocity.vzr: float¶
Initial rotational velocity about Z axis
- property Velocity.vzre: float¶
Initial rotational velocity about Z axis of exempted nodes
Constructor¶
- classmethod Velocity(model, nsid, vx, vy, vz, vxr, vyr, vzr, boxid=Oasys.gRPC.defaultArg, irigid=Oasys.gRPC.defaultArg, nsidex=Oasys.gRPC.defaultArg, vxe=Oasys.gRPC.defaultArg, vye=Oasys.gRPC.defaultArg, vze=Oasys.gRPC.defaultArg, vxre=Oasys.gRPC.defaultArg, vyre=Oasys.gRPC.defaultArg, vzre=Oasys.gRPC.defaultArg, icid=Oasys.gRPC.defaultArg)¶
Create a new
Velocity
object
- Parameters:
model (Model) –
Model
that velocity will be created innsid (integer) –
Set
Node set IDvx (float) – Initial velocity in X direction
vy (float) – Initial velocity in Y direction
vz (float) – Initial velocity in Z direction
vxr (float) – Initial rotational velocity about X axis
vyr (float) – Initial rotational velocity about Y axis
vzr (float) – Initial rotational velocity about Z axis
boxid (integer) – Optional. Define box containing nodes
irigid (integer) – Optional. IRIGID flag
nsidex (integer) – Optional.
Set
Exempted Node set IDvxe (float) – Optional. Initial velocity in X direction of exempted nodes
vye (float) – Optional. Initial velocity in Y direction of exempted nodes
vze (float) – Optional. Initial velocity in Z direction of exempted nodes
vxre (float) – Optional. Initial rotational velocity about X axis of exempted nodes
vyre (float) – Optional. Initial rotational velocity about Y axis of exempted nodes
vzre (float) – Optional. Initial rotational velocity about Z axis of exempted nodes
icid (float) – Optional. Local coordinate system nodes
- Returns:
Velocity object
- Return type:
dict
Example
To create a new velocity in model m
s = Oasys.PRIMER.Velocity(m, 1, 2.4, 3.7, 7.9, 0.0, 0.0, 0.0)
Static methods¶
- classmethod Velocity.BlankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the initial velocitys in the model
- Parameters:
model (Model) –
Model
that all initial velocitys 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 initial velocitys in model m:
Oasys.PRIMER.Velocity.BlankAll(m)
- classmethod Velocity.BlankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the flagged initial velocitys in the model
- Parameters:
model (Model) –
Model
that all the flagged initial velocitys will be blanked inflag (Flag) – Flag set on the initial velocitys 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 initial velocitys in model m flagged with f:
Oasys.PRIMER.Velocity.BlankFlagged(m, f)
- classmethod Velocity.First(model)¶
Returns the first initial velocity in the model
- Parameters:
model (Model) –
Model
to get first initial velocity in- Returns:
Velocity object (or None if there are no initial velocitys in the model)
- Return type:
Velocity
Example
To get the first initial velocity in model m:
v = Oasys.PRIMER.Velocity.First(m)
- classmethod Velocity.FlagAll(model, flag)¶
Flags all of the initial velocitys in the model with a defined flag
- Parameters:
model (Model) –
Model
that all initial velocitys will be flagged inflag (Flag) – Flag to set on the initial velocitys
- Returns:
No return value
- Return type:
None
Example
To flag all of the initial velocitys with flag f in model m:
Oasys.PRIMER.Velocity.FlagAll(m, f)
- classmethod Velocity.GetAll(model)¶
Returns a list of Velocity objects for all of the initial velocitys in a model in PRIMER
- Parameters:
model (Model) –
Model
to get initial velocitys from- Returns:
List of Velocity objects
- Return type:
list
Example
To make a list of Velocity objects for all of the initial velocitys in model m
v = Oasys.PRIMER.Velocity.GetAll(m)
- classmethod Velocity.GetFlagged(model, flag)¶
Returns a list of Velocity objects for all of the flagged initial velocitys in a model in PRIMER
- Parameters:
model (Model) –
Model
to get initial velocitys fromflag (Flag) – Flag set on the initial velocitys that you want to retrieve
- Returns:
List of Velocity objects
- Return type:
list
Example
To make a list of Velocity objects for all of the initial velocitys in model m flagged with f
v = Oasys.PRIMER.Velocity.GetFlagged(m, f)
- classmethod Velocity.GetFromID(model, number)¶
Returns the Velocity object for a initial velocity ID
- Parameters:
model (Model) –
Model
to find the initial velocity innumber (integer) – number of the initial velocity you want the Velocity object for
- Returns:
Velocity object (or None if initial velocity does not exist)
- Return type:
Velocity
Example
To get the Velocity object for initial velocity 100 in model m
v = Oasys.PRIMER.Velocity.GetFromID(m, 100)
- classmethod Velocity.Last(model)¶
Returns the last initial velocity in the model
- Parameters:
model (Model) –
Model
to get last initial velocity in- Returns:
Velocity object (or None if there are no initial velocitys in the model)
- Return type:
Velocity
Example
To get the last initial velocity in model m:
v = Oasys.PRIMER.Velocity.Last(m)
- classmethod Velocity.Pick(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)¶
Allows the user to pick a initial velocity
- 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 initial velocitys from that model can be picked. If the argument is aFlag
then only initial velocitys that are flagged with limit can be selected. If omitted, or None, any initial velocitys 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:
Velocity object (or None if not picked)
- Return type:
dict
Example
To pick a initial velocity from model m giving the prompt ‘Pick initial velocity from screen’:
v = Oasys.PRIMER.Velocity.Pick('Pick initial velocity from screen', m)
- classmethod Velocity.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)¶
Allows the user to select initial velocitys using standard PRIMER object menus
- Parameters:
flag (Flag) – Flag to use when selecting initial velocitys
prompt (string) – Text to display as a prompt to the user
limit (Model or Flag) – Optional. If the argument is a
Model
then only initial velocitys from that model can be selected. If the argument is aFlag
then only initial velocitys that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any initial velocitys 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 initial velocitys selected or None if menu cancelled
- Return type:
int
Example
To select initial velocitys from model m, flagging those selected with flag f, giving the prompt ‘Select initial velocitys’:
Oasys.PRIMER.Velocity.Select(f, 'Select initial velocitys', m)To select initial velocitys, flagging those selected with flag f but limiting selection to initial velocitys flagged with flag l, giving the prompt ‘Select initial velocitys’:
Oasys.PRIMER.Velocity.Select(f, 'Select initial velocitys', l)
- classmethod Velocity.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Sketches all of the flagged initial velocitys in the model. The initial velocitys will be sketched until you either call
Velocity.Unsketch()
,Velocity.UnsketchFlagged()
,Model.UnsketchAll()
, or delete the model
- Parameters:
model (Model) –
Model
that all the flagged initial velocitys will be sketched inflag (Flag) – Flag set on the initial velocitys that you want to sketch
redraw (boolean) – Optional. If model should be redrawn or not after the initial velocitys are sketched. If omitted redraw is true. If you want to sketch flagged initial velocitys 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 initial velocitys flagged with flag in model m:
Oasys.PRIMER.Velocity.SketchFlagged(m, flag)
- classmethod Velocity.Total(model, exists=Oasys.gRPC.defaultArg)¶
Returns the total number of initial velocitys in the model
- Parameters:
model (Model) –
Model
to get total forexists (boolean) – Optional. true if only existing initial velocitys should be counted. If false or omitted referenced but undefined initial velocitys will also be included in the total
- Returns:
number of initial velocitys
- Return type:
int
Example
To get the total number of initial velocitys in model m:
total = Oasys.PRIMER.Velocity.Total(m)
- classmethod Velocity.UnblankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the initial velocitys in the model
- Parameters:
model (Model) –
Model
that all initial velocitys 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 initial velocitys in model m:
Oasys.PRIMER.Velocity.UnblankAll(m)
- classmethod Velocity.UnblankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the flagged initial velocitys in the model
- Parameters:
model (Model) –
Model
that the flagged initial velocitys will be unblanked inflag (Flag) – Flag set on the initial velocitys 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 initial velocitys in model m flagged with f:
Oasys.PRIMER.Velocity.UnblankFlagged(m, f)
- classmethod Velocity.UnflagAll(model, flag)¶
Unsets a defined flag on all of the initial velocitys in the model
- Parameters:
model (Model) –
Model
that the defined flag for all initial velocitys will be unset inflag (Flag) – Flag to unset on the initial velocitys
- Returns:
No return value
- Return type:
None
Example
To unset the flag f on all the initial velocitys in model m:
Oasys.PRIMER.Velocity.UnflagAll(m, f)
- classmethod Velocity.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all initial velocitys
- Parameters:
model (Model) –
Model
that all initial velocitys will be unblanked inredraw (boolean) – Optional. If model should be redrawn or not after the initial velocitys 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 initial velocitys in model m:
Oasys.PRIMER.Velocity.UnsketchAll(m)
- classmethod Velocity.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all flagged initial velocitys in the model
- Parameters:
model (Model) –
Model
that all initial velocitys will be unsketched inflag (Flag) – Flag set on the initial velocitys that you want to unsketch
redraw (boolean) – Optional. If model should be redrawn or not after the initial velocitys 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 initial velocitys flagged with flag in model m:
Oasys.PRIMER.Velocity.UnsketchAll(m, flag)
Instance methods¶
- Velocity.AssociateComment(comment)¶
Associates a comment with a initial velocity
- Parameters:
comment (Comment) –
Comment
that will be attached to the initial velocity- Returns:
No return value
- Return type:
None
Example
To associate comment c to the initial velocity v:
v.AssociateComment(c)
- Velocity.Blank()¶
Blanks the initial velocity
- Returns:
No return value
- Return type:
None
Example
To blank initial velocity v:
v.Blank()
- Velocity.Blanked()¶
Checks if the initial velocity is blanked or not
- Returns:
True if blanked, False if not
- Return type:
bool
Example
To check if initial velocity v is blanked:
if v.Blanked(): do_something..
- Velocity.ClearFlag(flag)¶
Clears a flag on the initial velocity
- Parameters:
flag (Flag) – Flag to clear on the initial velocity
- Returns:
No return value
- Return type:
None
Example
To clear flag f for initial velocity v:
v.ClearFlag(f)
- Velocity.Copy(range=Oasys.gRPC.defaultArg)¶
Copies the initial velocity. The target include of the copied initial velocity 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:
Velocity object
- Return type:
Velocity
Example
To copy initial velocity v into initial velocity z:
z = v.Copy()
- Velocity.DetachComment(comment)¶
Detaches a comment from a initial velocity
- Parameters:
comment (Comment) –
Comment
that will be detached from the initial velocity- Returns:
No return value
- Return type:
None
Example
To detach comment c from the initial velocity v:
v.DetachComment(c)
- Velocity.Flagged(flag)¶
Checks if the initial velocity is flagged or not
- Parameters:
flag (Flag) – Flag to test on the initial velocity
- Returns:
True if flagged, False if not
- Return type:
bool
Example
To check if initial velocity v has flag f set on it:
if v.Flagged(f): do_something..
- Velocity.GetComments()¶
Extracts the comments associated to a initial velocity
- 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 initial velocity v:
comm_list = v.GetComments()
- Velocity.GetParameter(prop)¶
Checks if a Velocity 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 theVelocity.ViewParameters()
method and ‘method chaining’ (see the examples below)
- Parameters:
prop (string) – initial velocity property to get parameter for
- Returns:
Parameter object if property is a parameter, None if not
- Return type:
dict
Example
To check if Velocity property v.example is a parameter:
Oasys.PRIMER.Options.property_parameter_names = True if v.GetParameter(v.example): do_something... Oasys.PRIMER.Options.property_parameter_names = FalseTo check if Velocity property v.example is a parameter by using the GetParameter method:
if v.ViewParameters().GetParameter(v.example): do_something..
- Velocity.Keyword()¶
Returns the keyword for this initial velocity (*INITIAL_VELOCITY). Note that a carriage return is not added. See also
Velocity.KeywordCards()
- Returns:
string containing the keyword
- Return type:
str
Example
To get the keyword for velocity i:
key = i.Keyword()
- Velocity.KeywordCards()¶
Returns the keyword cards for the initial velocity. Note that a carriage return is not added. See also
Velocity.Keyword()
- Returns:
string containing the cards
- Return type:
str
Example
To get the cards for velocity i:
cards = i.KeywordCards()
- Velocity.Next()¶
Returns the next initial velocity in the model
- Returns:
Velocity object (or None if there are no more initial velocitys in the model)
- Return type:
Velocity
Example
To get the initial velocity in model m after initial velocity v:
v = v.Next()
- Velocity.Previous()¶
Returns the previous initial velocity in the model
- Returns:
Velocity object (or None if there are no more initial velocitys in the model)
- Return type:
Velocity
Example
To get the initial velocity in model m before initial velocity v:
v = v.Previous()
- Velocity.SetFlag(flag)¶
Sets a flag on the initial velocity
- Parameters:
flag (Flag) – Flag to set on the initial velocity
- Returns:
No return value
- Return type:
None
Example
To set flag f for initial velocity v:
v.SetFlag(f)
- Velocity.Sketch(redraw=Oasys.gRPC.defaultArg)¶
Sketches the initial velocity. The initial velocity will be sketched until you either call
Velocity.Unsketch()
,Velocity.UnsketchAll()
,Model.UnsketchAll()
, or delete the model
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the initial velocity is sketched. If omitted redraw is true. If you want to sketch several initial velocitys 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 initial velocity v:
v.Sketch()
- Velocity.Unblank()¶
Unblanks the initial velocity
- Returns:
No return value
- Return type:
None
Example
To unblank initial velocity v:
v.Unblank()
- Velocity.Unsketch(redraw=Oasys.gRPC.defaultArg)¶
Unsketches the initial velocity
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the initial velocity is unsketched. If omitted redraw is true. If you want to unsketch several initial velocitys 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 initial velocity v:
v.Unsketch()
- Velocity.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:
Velocity object
- Return type:
dict
Example
To check if Velocity property v.example is a parameter by using the
Velocity.GetParameter()
method:if v.ViewParameters().GetParameter(v.example): do_something..
- Velocity.Xrefs()¶
Returns the cross references for this initial velocity
- Returns:
Xrefs object
- Return type:
dict
Example
To get the cross references for initial velocity v:
xrefs = v.Xrefs()