Oasys.PRIMER.VelocityGeneration class¶
Constants¶
Properties¶
- property VelocityGeneration.exists(read only): boolean¶
true if velocity exists, false if referred to but not defined
- property VelocityGeneration.icid: integer¶
Local coordinate system
- property VelocityGeneration.include: integer¶
The
Include
file number that the initial velocity is in
- property VelocityGeneration.irigid: integer¶
Overide part inertia flag
- property VelocityGeneration.ivatn: integer¶
Tracked parts flag
- property VelocityGeneration.model(read only): integer¶
The
Model
number that the initial velocity generation is in
- property VelocityGeneration.nx: float¶
x-direction cosine
- property VelocityGeneration.ny: float¶
y-direction cosine
- property VelocityGeneration.nz: float¶
z-direction cosine
- property VelocityGeneration.omega: float¶
Angular velocity about the rotational axis
- property VelocityGeneration.phase: integer¶
Dynamic relaxation flag
- property VelocityGeneration.type: constant¶
Specify the type of Velocity generation (Can be
VelocityGeneration.PART_SET
orVelocityGeneration.PART
orVelocityGeneration.NODE_SET
)
- property VelocityGeneration.vx: float¶
Initial translational velocity in X direction
- property VelocityGeneration.vy: float¶
Initial translational velocity in Y direction
- property VelocityGeneration.vz: float¶
Initial translational velocity in Z direction
- property VelocityGeneration.xc: float¶
x-coordinate on rotational axis
- property VelocityGeneration.yc: float¶
y-coordinate on rotational axis
- property VelocityGeneration.zc: float¶
z-coordinate on rotational axis
Constructor¶
- classmethod VelocityGeneration(model, type, id, omega, vx, vy, vz, ivatn, xc, yc, zc, nx, ny, nz, phase, irigid, icid)¶
Create a new
VelocityGeneration
object
- Parameters:
model (Model) –
Model
that velocity will be created intype (constant) – Specify the type of Velocity generation (Can be
VelocityGeneration.PART_SET
orVelocityGeneration.PART
orVelocityGeneration.NODE_SET
)id (integer) –
Set
Part ID, Part set ID or Node set IDomega (float) – Angular velocity about the rotational axis
vx (float) – Initial translational velocity in X direction
vy (float) – Initial translational velocity in Y direction
vz (float) – Initial translational velocity in Z direction
ivatn (integer) – Tracked parts flag
xc (float) – x-coordinate on rotational axis
yc (float) – y-coordinate on rotational axis
zc (float) – z-coordinate on rotational axis
nx (float) – x-direction cosine
ny (float) – y-direction cosine
nz (float) – z-direction cosine
phase (integer) – Dynamic relaxation flag
irigid (integer) – Overide part inertia flag
icid (integer) – Local coordinate system
- Returns:
VelocityGeneration object
- Return type:
dict
Example
To create a new velocity in model m
s = Oasys.PRIMER.VelocityGeneration(m, Oasys.PRIMER.VelocityGeneration.PART, 500, 3.4, 2.4, 3.7, 7.9, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1, 0)
Static methods¶
- classmethod VelocityGeneration.BlankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the initial velocity generations in the model
- Parameters:
model (Model) –
Model
that all initial velocity generations 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 velocity generations in model m:
Oasys.PRIMER.VelocityGeneration.BlankAll(m)
- classmethod VelocityGeneration.BlankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Blanks all of the flagged initial velocity generations in the model
- Parameters:
model (Model) –
Model
that all the flagged initial velocity generations will be blanked inflag (Flag) – Flag set on the initial velocity generations 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 velocity generations in model m flagged with f:
Oasys.PRIMER.VelocityGeneration.BlankFlagged(m, f)
- classmethod VelocityGeneration.Create(model, modal=Oasys.gRPC.defaultArg)¶
Starts an interactive editing panel to create an initial velocity generation definition
- Parameters:
model (Model) –
Model
that the initial velocity generation definition 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:
VelocityGeneration object (or None if not made)
- Return type:
dict
Example
To start creating an initial velocity generation definition in model m:
v = Oasys.PRIMER.VelocityGeneration.Create(m)
- classmethod VelocityGeneration.First(model)¶
Returns the first initial velocity generation in the model
- Parameters:
model (Model) –
Model
to get first initial velocity generation in- Returns:
VelocityGeneration object (or None if there are no initial velocity generations in the model)
- Return type:
VelocityGeneration
Example
To get the first initial velocity generation in model m:
ivg = Oasys.PRIMER.VelocityGeneration.First(m)
- classmethod VelocityGeneration.FlagAll(model, flag)¶
Flags all of the initial velocity generations in the model with a defined flag
- Parameters:
model (Model) –
Model
that all initial velocity generations will be flagged inflag (Flag) – Flag to set on the initial velocity generations
- Returns:
No return value
- Return type:
None
Example
To flag all of the initial velocity generations with flag f in model m:
Oasys.PRIMER.VelocityGeneration.FlagAll(m, f)
- classmethod VelocityGeneration.GetAll(model)¶
Returns a list of VelocityGeneration objects for all of the initial velocity generations in a model in PRIMER
- Parameters:
model (Model) –
Model
to get initial velocity generations from- Returns:
List of VelocityGeneration objects
- Return type:
list
Example
To make a list of VelocityGeneration objects for all of the initial velocity generations in model m
ivg = Oasys.PRIMER.VelocityGeneration.GetAll(m)
- classmethod VelocityGeneration.GetFlagged(model, flag)¶
Returns a list of VelocityGeneration objects for all of the flagged initial velocity generations in a model in PRIMER
- Parameters:
model (Model) –
Model
to get initial velocity generations fromflag (Flag) – Flag set on the initial velocity generations that you want to retrieve
- Returns:
List of VelocityGeneration objects
- Return type:
list
Example
To make a list of VelocityGeneration objects for all of the initial velocity generations in model m flagged with f
ivg = Oasys.PRIMER.VelocityGeneration.GetFlagged(m, f)
- classmethod VelocityGeneration.GetFromID(model, number)¶
Returns the VelocityGeneration object for a initial velocity generation ID
- Parameters:
model (Model) –
Model
to find the initial velocity generation innumber (integer) – number of the initial velocity generation you want the VelocityGeneration object for
- Returns:
VelocityGeneration object (or None if initial velocity generation does not exist)
- Return type:
VelocityGeneration
Example
To get the VelocityGeneration object for initial velocity generation 100 in model m
ivg = Oasys.PRIMER.VelocityGeneration.GetFromID(m, 100)
- classmethod VelocityGeneration.Last(model)¶
Returns the last initial velocity generation in the model
- Parameters:
model (Model) –
Model
to get last initial velocity generation in- Returns:
VelocityGeneration object (or None if there are no initial velocity generations in the model)
- Return type:
VelocityGeneration
Example
To get the last initial velocity generation in model m:
ivg = Oasys.PRIMER.VelocityGeneration.Last(m)
- classmethod VelocityGeneration.Pick(prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg, button_text=Oasys.gRPC.defaultArg)¶
Allows the user to pick a initial velocity generation
- 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 velocity generations from that model can be picked. If the argument is aFlag
then only initial velocity generations that are flagged with limit can be selected. If omitted, or None, any initial velocity generations 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:
VelocityGeneration object (or None if not picked)
- Return type:
dict
Example
To pick a initial velocity generation from model m giving the prompt ‘Pick initial velocity generation from screen’:
ivg = Oasys.PRIMER.VelocityGeneration.Pick('Pick initial velocity generation from screen', m)
- classmethod VelocityGeneration.Select(flag, prompt, limit=Oasys.gRPC.defaultArg, modal=Oasys.gRPC.defaultArg)¶
Allows the user to select initial velocity generations using standard PRIMER object menus
- Parameters:
flag (Flag) – Flag to use when selecting initial velocity generations
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 velocity generations from that model can be selected. If the argument is aFlag
then only initial velocity generations that are flagged with limit can be selected (limit should be different to flag). If omitted, or None, any initial velocity generations 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 velocity generations selected or None if menu cancelled
- Return type:
int
Example
To select initial velocity generations from model m, flagging those selected with flag f, giving the prompt ‘Select initial velocity generations’:
Oasys.PRIMER.VelocityGeneration.Select(f, 'Select initial velocity generations', m)To select initial velocity generations, flagging those selected with flag f but limiting selection to initial velocity generations flagged with flag l, giving the prompt ‘Select initial velocity generations’:
Oasys.PRIMER.VelocityGeneration.Select(f, 'Select initial velocity generations', l)
- classmethod VelocityGeneration.SketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Sketches all of the flagged initial velocity generations in the model. The initial velocity generations will be sketched until you either call
VelocityGeneration.Unsketch()
,VelocityGeneration.UnsketchFlagged()
,Model.UnsketchAll()
, or delete the model
- Parameters:
model (Model) –
Model
that all the flagged initial velocity generations will be sketched inflag (Flag) – Flag set on the initial velocity generations that you want to sketch
redraw (boolean) – Optional. If model should be redrawn or not after the initial velocity generations are sketched. If omitted redraw is true. If you want to sketch flagged initial velocity generations 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 velocity generations flagged with flag in model m:
Oasys.PRIMER.VelocityGeneration.SketchFlagged(m, flag)
- classmethod VelocityGeneration.Total(model, exists=Oasys.gRPC.defaultArg)¶
Returns the total number of initial velocity generations in the model
- Parameters:
model (Model) –
Model
to get total forexists (boolean) – Optional. true if only existing initial velocity generations should be counted. If false or omitted referenced but undefined initial velocity generations will also be included in the total
- Returns:
number of initial velocity generations
- Return type:
int
Example
To get the total number of initial velocity generations in model m:
total = Oasys.PRIMER.VelocityGeneration.Total(m)
- classmethod VelocityGeneration.UnblankAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the initial velocity generations in the model
- Parameters:
model (Model) –
Model
that all initial velocity generations 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 velocity generations in model m:
Oasys.PRIMER.VelocityGeneration.UnblankAll(m)
- classmethod VelocityGeneration.UnblankFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unblanks all of the flagged initial velocity generations in the model
- Parameters:
model (Model) –
Model
that the flagged initial velocity generations will be unblanked inflag (Flag) – Flag set on the initial velocity generations 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 velocity generations in model m flagged with f:
Oasys.PRIMER.VelocityGeneration.UnblankFlagged(m, f)
- classmethod VelocityGeneration.UnflagAll(model, flag)¶
Unsets a defined flag on all of the initial velocity generations in the model
- Parameters:
model (Model) –
Model
that the defined flag for all initial velocity generations will be unset inflag (Flag) – Flag to unset on the initial velocity generations
- Returns:
No return value
- Return type:
None
Example
To unset the flag f on all the initial velocity generations in model m:
Oasys.PRIMER.VelocityGeneration.UnflagAll(m, f)
- classmethod VelocityGeneration.UnsketchAll(model, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all initial velocity generations
- Parameters:
model (Model) –
Model
that all initial velocity generations will be unblanked inredraw (boolean) – Optional. If model should be redrawn or not after the initial velocity generations 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 velocity generations in model m:
Oasys.PRIMER.VelocityGeneration.UnsketchAll(m)
- classmethod VelocityGeneration.UnsketchFlagged(model, flag, redraw=Oasys.gRPC.defaultArg)¶
Unsketches all flagged initial velocity generations in the model
- Parameters:
model (Model) –
Model
that all initial velocity generations will be unsketched inflag (Flag) – Flag set on the initial velocity generations that you want to unsketch
redraw (boolean) – Optional. If model should be redrawn or not after the initial velocity generations 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 velocity generations flagged with flag in model m:
Oasys.PRIMER.VelocityGeneration.UnsketchAll(m, flag)
Instance methods¶
- VelocityGeneration.AssociateComment(comment)¶
Associates a comment with a initial velocity generation
- Parameters:
comment (Comment) –
Comment
that will be attached to the initial velocity generation- Returns:
No return value
- Return type:
None
Example
To associate comment c to the initial velocity generation ivg:
ivg.AssociateComment(c)
- VelocityGeneration.Blank()¶
Blanks the initial velocity generation
- Returns:
No return value
- Return type:
None
Example
To blank initial velocity generation ivg:
ivg.Blank()
- VelocityGeneration.Blanked()¶
Checks if the initial velocity generation is blanked or not
- Returns:
True if blanked, False if not
- Return type:
bool
Example
To check if initial velocity generation ivg is blanked:
if ivg.Blanked(): do_something..
- VelocityGeneration.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 initial velocity generation ivg:
ivg.Browse()
- VelocityGeneration.ClearFlag(flag)¶
Clears a flag on the initial velocity generation
- Parameters:
flag (Flag) – Flag to clear on the initial velocity generation
- Returns:
No return value
- Return type:
None
Example
To clear flag f for initial velocity generation ivg:
ivg.ClearFlag(f)
- VelocityGeneration.Copy(range=Oasys.gRPC.defaultArg)¶
Copies the initial velocity generation. The target include of the copied initial velocity generation 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:
VelocityGeneration object
- Return type:
VelocityGeneration
Example
To copy initial velocity generation ivg into initial velocity generation z:
z = ivg.Copy()
- VelocityGeneration.DetachComment(comment)¶
Detaches a comment from a initial velocity generation
- Parameters:
comment (Comment) –
Comment
that will be detached from the initial velocity generation- Returns:
No return value
- Return type:
None
Example
To detach comment c from the initial velocity generation ivg:
ivg.DetachComment(c)
- VelocityGeneration.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 initial velocity generation ivg:
ivg.Edit()
- VelocityGeneration.Flagged(flag)¶
Checks if the initial velocity generation is flagged or not
- Parameters:
flag (Flag) – Flag to test on the initial velocity generation
- Returns:
True if flagged, False if not
- Return type:
bool
Example
To check if initial velocity generation ivg has flag f set on it:
if ivg.Flagged(f): do_something..
- VelocityGeneration.GetComments()¶
Extracts the comments associated to a initial velocity generation
- 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 generation ivg:
comm_list = ivg.GetComments()
- VelocityGeneration.GetParameter(prop)¶
Checks if a VelocityGeneration 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 theVelocityGeneration.ViewParameters()
method and ‘method chaining’ (see the examples below)
- Parameters:
prop (string) – initial velocity generation property to get parameter for
- Returns:
Parameter object if property is a parameter, None if not
- Return type:
dict
Example
To check if VelocityGeneration property ivg.example is a parameter:
Oasys.PRIMER.Options.property_parameter_names = True if ivg.GetParameter(ivg.example): do_something... Oasys.PRIMER.Options.property_parameter_names = FalseTo check if VelocityGeneration property ivg.example is a parameter by using the GetParameter method:
if ivg.ViewParameters().GetParameter(ivg.example): do_something..
- VelocityGeneration.Keyword()¶
Returns the keyword for this initial velocity (*INITIAL_VELOCITY_GENERATION). Note that a carriage return is not added. See also
VelocityGeneration.KeywordCards()
- Returns:
string containing the keyword
- Return type:
str
Example
To get the keyword for velocity i:
key = i.Keyword()
- VelocityGeneration.KeywordCards()¶
Returns the keyword cards for the initial velocity_generation. Note that a carriage return is not added. See also
VelocityGeneration.Keyword()
- Returns:
string containing the cards
- Return type:
str
Example
To get the cards for velocity i:
cards = i.KeywordCards()
- VelocityGeneration.Next()¶
Returns the next initial velocity generation in the model
- Returns:
VelocityGeneration object (or None if there are no more initial velocity generations in the model)
- Return type:
VelocityGeneration
Example
To get the initial velocity generation in model m after initial velocity generation ivg:
ivg = ivg.Next()
- VelocityGeneration.Previous()¶
Returns the previous initial velocity generation in the model
- Returns:
VelocityGeneration object (or None if there are no more initial velocity generations in the model)
- Return type:
VelocityGeneration
Example
To get the initial velocity generation in model m before initial velocity generation ivg:
ivg = ivg.Previous()
- VelocityGeneration.SetFlag(flag)¶
Sets a flag on the initial velocity generation
- Parameters:
flag (Flag) – Flag to set on the initial velocity generation
- Returns:
No return value
- Return type:
None
Example
To set flag f for initial velocity generation ivg:
ivg.SetFlag(f)
- VelocityGeneration.Sketch(redraw=Oasys.gRPC.defaultArg)¶
Sketches the initial velocity generation. The initial velocity generation will be sketched until you either call
VelocityGeneration.Unsketch()
,VelocityGeneration.UnsketchAll()
,Model.UnsketchAll()
, or delete the model
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the initial velocity generation is sketched. If omitted redraw is true. If you want to sketch several initial velocity generations 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 generation ivg:
ivg.Sketch()
- VelocityGeneration.Unblank()¶
Unblanks the initial velocity generation
- Returns:
No return value
- Return type:
None
Example
To unblank initial velocity generation ivg:
ivg.Unblank()
- VelocityGeneration.Unsketch(redraw=Oasys.gRPC.defaultArg)¶
Unsketches the initial velocity generation
- Parameters:
redraw (boolean) – Optional. If model should be redrawn or not after the initial velocity generation is unsketched. If omitted redraw is true. If you want to unsketch several initial velocity generations 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 generation ivg:
ivg.Unsketch()
- VelocityGeneration.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:
VelocityGeneration object
- Return type:
dict
Example
To check if VelocityGeneration property ivg.example is a parameter by using the
VelocityGeneration.GetParameter()
method:if ivg.ViewParameters().GetParameter(ivg.example): do_something..
- VelocityGeneration.Xrefs()¶
Returns the cross references for this initial velocity generation
- Returns:
Xrefs object
- Return type:
dict
Example
To get the cross references for initial velocity generation ivg:
xrefs = ivg.Xrefs()