The Velocity class gives you access to define initial velocity cards in PRIMER. More...
The PRIMER JavaScript API provides many class constants, properties and methods. For Arup to
be able to extend and enhance the API in the future any constant, property or method names beginning with a lowercase
or uppercase letter are reserved.
If you need to add your own properties or methods to one of the existing classes then to avoid any potential future conflict you
should ensure that the name begins with either an underscore (_) or a dollar sign ($) or the name is prefixed with your
own unique identifier.
For example if company 'ABC' need to add a property called 'example' then to avoid any potential future conflict use one of:
| Name | Type | Description |
| boxid | integer | Define box containing nodes |
| exists (read only) | logical | true if initial velocity exists, false if referred to but not defined. |
| icid | integer | Local coordinate system |
| include | integer | The Include file number that the initial velocity is in. |
| irigid | integer | IRIGID flag |
| model (read only) | integer | The Model number that the initial velocity is in. |
| nsid | integer | Set Node set ID |
| nsidex | integer | Set Exempted Node set ID |
| vx | real | Initial velocity in X direction |
| vxe | real | Initial velocity in X direction of exempted nodes |
| vxr | real | Initial rotational velocity about X axis |
| vxre | real | Initial rotational velocity about X axis of exempted nodes |
| vy | real | Initial velocity in Y direction |
| vye | real | Initial velocity in Y direction of exempted nodes |
| vyr | real | Initial rotational velocity about Y axis |
| vyre | real | Initial rotational velocity about Y axis of exempted nodes |
| vz | real | Initial velocity in Z direction |
| vze | real | Initial velocity in Z direction of exempted nodes |
| vzr | real | Initial rotational velocity about Z axis |
| vzre | real | Initial rotational velocity about Z axis of exempted nodes |
Detailed DescriptionThe Velocity class allows you to create, modify, edit and manipulate velocity cards. See the documentation below for more details. |
Constructornew Velocity(Model[Model], nsid[integer], vx[real], vy[real], vz[real], vxr[real], vyr[real], vzr[real], boxid (optional)[integer], irigid (optional)[integer], nsidex (optional)[integer], vxe (optional)[real], vye (optional)[real], vze (optional)[real], vxre (optional)[real], vyre (optional)[real], vzre (optional)[real], icid (optional)[real])DescriptionCreate a new Velocity object. |
Model that velocity will be created in
Set Node set ID
Initial velocity in X direction
Initial velocity in Y direction
Initial velocity in Z direction
Initial rotational velocity about X axis
Initial rotational velocity about Y axis
Initial rotational velocity about Z axis
Define box containing nodes
IRIGID flag
Set Exempted Node set ID
Initial velocity in X direction of exempted nodes
Initial velocity in Y direction of exempted nodes
Initial velocity in Z direction of exempted nodes
Initial rotational velocity about X axis of exempted nodes
Initial rotational velocity about Y axis of exempted nodes
Initial rotational velocity about Z axis of exempted nodes
Local coordinate system nodes
ReturnsVelocity object Return typeVelocity |
ExampleTo create a new velocity in model m var s = new Velocity(m, 1, 2.4, 3.7, 7.9, 0.0, 0.0, 0.0);
|
Details of functionsAssociateComment(Comment[Comment])DescriptionAssociates a comment with a initial velocity. |
Comment that will be attached to the initial velocity
ReturnsNo return value |
ExampleTo associate comment c to the initial velocity v: v.AssociateComment(c);
|
Blank()DescriptionBlanks the initial velocity |
No arguments
ReturnsNo return value |
ExampleTo blank initial velocity v: v.Blank();
|
BlankAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionBlanks all of the initial velocities in the model. |
Model that all initial velocities will be blanked in
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().
ReturnsNo return value |
ExampleTo blank all of the initial velocities in model m: Velocity.BlankAll(m);
|
BlankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionBlanks all of the flagged initial velocities in the model. |
Model that all the flagged initial velocities will be blanked in
Flag set on the initial velocities that you want to blank
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().
ReturnsNo return value |
ExampleTo blank all of the initial velocities in model m flagged with f: Velocity.BlankFlagged(m, f);
|
Blanked()DescriptionChecks if the initial velocity is blanked or not. |
No arguments
Returnstrue if blanked, false if not. Return typeBoolean |
ExampleTo check if initial velocity v is blanked: if (v.Blanked() ) do_something...
|
ClearFlag(flag[Flag])DescriptionClears a flag on the initial velocity. |
Flag to clear on the initial velocity
ReturnsNo return value |
ExampleTo clear flag f for initial velocity v: v.ClearFlag(f);
|
Copy(range (optional)[boolean])DescriptionCopies the initial velocity. The target include of the copied initial velocity can be set using Options.copy_target_include. |
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().
ReturnsVelocity object Return typeVelocity |
ExampleTo copy initial velocity v into initial velocity z: var z = v.Copy();
|
DetachComment(Comment[Comment])DescriptionDetaches a comment from a initial velocity. |
Comment that will be detached from the initial velocity
ReturnsNo return value |
ExampleTo detach comment c from the initial velocity v: v.DetachComment(c);
|
Error(message[string], details (optional)[string])DescriptionAdds an error for initial velocity. For more details on checking see the Check class. |
The error message to give
An optional detailed error message
ReturnsNo return value |
ExampleTo add an error message "My custom error" for initial velocity v: v.Error("My custom error");
|
First(Model[Model]) [static]DescriptionReturns the first initial velocity in the model. |
Model to get first initial velocity in
ReturnsVelocity object (or null if there are no initial velocities in the model). Return typeVelocity |
ExampleTo get the first initial velocity in model m: var v = Velocity.First(m);
|
FlagAll(Model[Model], flag[Flag]) [static]DescriptionFlags all of the initial velocities in the model with a defined flag. |
Model that all initial velocities will be flagged in
Flag to set on the initial velocities
ReturnsNo return value |
ExampleTo flag all of the initial velocities with flag f in model m: Velocity.FlagAll(m, f);
|
Flagged(flag[Flag])DescriptionChecks if the initial velocity is flagged or not. |
Flag to test on the initial velocity
Returnstrue if flagged, false if not. Return typeBoolean |
ExampleTo check if initial velocity v has flag f set on it: if (v.Flagged(f) ) do_something...
|
ForEach(Model[Model], func[function], extra (optional)[any]) [static]DescriptionCalls a function for each initial velocity in the model. |
Model that all initial velocities are in
Function to call for each initial velocity
An optional extra object/array/string etc that will appended to arguments when calling the function
ReturnsNo return value |
GetAll(Model[Model], property (optional)[string]) [static]DescriptionReturns an array of Velocity objects or properties for all of the initial velocities in a model in PRIMER. If the optional property argument is not given then an array of Velocity objects is returned. If the property argument is given, that property value for each initial velocity is returned in the array instead of a Velocity object |
Model to get initial velocities from
Name for property to get for all initial velocities in the model
ReturnsArray of Velocity objects or properties Return typeArray |
GetComments()DescriptionExtracts the comments associated to a initial velocity. |
No arguments
ReturnsArray of Comment objects (or null if there are no comments associated to the node). Return typeArray |
ExampleTo get the array of comments associated to the initial velocity v: var comm_array = v.GetComments();
|
GetFlagged(Model[Model], flag[Flag], property (optional)[string]) [static]DescriptionReturns an array of Velocity objects for all of the flagged initial velocities in a model in PRIMER If the optional property argument is not given then an array of Velocity objects is returned. If the property argument is given, then that property value for each initial velocity is returned in the array instead of a Velocity object |
Model to get initial velocities from
Flag set on the initial velocities that you want to retrieve
Name for property to get for all flagged initial velocities in the model
ReturnsArray of Velocity objects or properties Return typeArray |
GetFromID(Model[Model], number[integer]) [static]DescriptionReturns the Velocity object for a initial velocity ID. |
Model to find the initial velocity in
number of the initial velocity you want the Velocity object for
ReturnsVelocity object (or null if initial velocity does not exist). Return typeVelocity |
ExampleTo get the Velocity object for initial velocity 100 in model m var v = Velocity.GetFromID(m, 100);
|
GetParameter(prop[string])DescriptionChecks 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 the Velocity.ViewParameters() method and 'method chaining' (see the examples below). |
initial velocity property to get parameter for
ReturnsParameter object if property is a parameter, null if not. Return typeParameter |
Keyword()DescriptionReturns the keyword for this initial velocity (*INITIAL_VELOCITY). Note that a carriage return is not added. See also Velocity.KeywordCards() |
No arguments
Returnsstring containing the keyword. Return typeString |
ExampleTo get the keyword for velocity i: var key = i.Keyword();
|
KeywordCards()DescriptionReturns the keyword cards for the initial velocity. Note that a carriage return is not added. See also Velocity.Keyword() |
No arguments
Returnsstring containing the cards. Return typeString |
ExampleTo get the cards for velocity i: var cards = i.KeywordCards();
|
Last(Model[Model]) [static]DescriptionReturns the last initial velocity in the model. |
Model to get last initial velocity in
ReturnsVelocity object (or null if there are no initial velocities in the model). Return typeVelocity |
ExampleTo get the last initial velocity in model m: var v = Velocity.Last(m);
|
Next()DescriptionReturns the next initial velocity in the model. |
No arguments
ReturnsVelocity object (or null if there are no more initial velocities in the model). Return typeVelocity |
ExampleTo get the initial velocity in model m after initial velocity v: var v = v.Next();
|
Pick(prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean], button text (optional)[string]) [static]DescriptionAllows the user to pick a initial velocity. |
Text to display as a prompt to the user
If the argument is a Model then only initial velocities from that model can be picked. If the argument is a Flag then only initial velocities that are flagged with limit can be selected. If omitted, or null, any initial velocities from any model can be selected. from any model.
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.
By default the window with the prompt will have a button labelled 'Cancel' which if pressed will cancel the pick and return null. If you want to change the text on the button use this argument. If omitted 'Cancel' will be used.
ReturnsVelocity object (or null if not picked) Return typeVelocity |
ExampleTo pick a initial velocity from model m giving the prompt 'Pick initial velocity from screen': var v = Velocity.Pick('Pick initial velocity from screen', m);
|
Previous()DescriptionReturns the previous initial velocity in the model. |
No arguments
ReturnsVelocity object (or null if there are no more initial velocities in the model). Return typeVelocity |
ExampleTo get the initial velocity in model m before initial velocity v: var v = v.Previous();
|
Select(flag[Flag], prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean]) [static]DescriptionAllows the user to select initial velocities using standard PRIMER object menus. |
Flag to use when selecting initial velocities
Text to display as a prompt to the user
If the argument is a Model then only initial velocities from that model can be selected. If the argument is a Flag then only initial velocities that are flagged with limit can be selected (limit should be different to flag). If omitted, or null, any initial velocities can be selected. from any model.
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.
ReturnsNumber of initial velocities selected or null if menu cancelled Return typeNumber |
SetFlag(flag[Flag])DescriptionSets a flag on the initial velocity. |
Flag to set on the initial velocity
ReturnsNo return value |
ExampleTo set flag f for initial velocity v: v.SetFlag(f);
|
Sketch(redraw (optional)[boolean])DescriptionSketches the initial velocity. The initial velocity will be sketched until you either call Velocity.Unsketch(), Velocity.UnsketchAll(), Model.UnsketchAll(), or delete the model |
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 velocities and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo sketch initial velocity v: v.Sketch();
|
SketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionSketches all of the flagged initial velocities in the model. The initial velocities will be sketched until you either call Velocity.Unsketch(), Velocity.UnsketchFlagged(), Model.UnsketchAll(), or delete the model |
Model that all the flagged initial velocities will be sketched in
Flag set on the initial velocities that you want to sketch
If model should be redrawn or not after the initial velocities are sketched. If omitted redraw is true. If you want to sketch flagged initial velocities several times and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo sketch all initial velocities flagged with flag in model m: Velocity.SketchFlagged(m, flag);
|
Total(Model[Model], exists (optional)[boolean]) [static]DescriptionReturns the total number of initial velocities in the model. |
Model to get total for
true if only existing initial velocities should be counted. If false or omitted referenced but undefined initial velocities will also be included in the total.
Returnsnumber of initial velocities Return typeNumber |
ExampleTo get the total number of initial velocities in model m: var total = Velocity.Total(m);
|
Unblank()DescriptionUnblanks the initial velocity |
No arguments
ReturnsNo return value |
ExampleTo unblank initial velocity v: v.Unblank();
|
UnblankAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the initial velocities in the model. |
Model that all initial velocities will be unblanked in
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().
ReturnsNo return value |
ExampleTo unblank all of the initial velocities in model m: Velocity.UnblankAll(m);
|
UnblankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the flagged initial velocities in the model. |
Model that the flagged initial velocities will be unblanked in
Flag set on the initial velocities that you want to unblank
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().
ReturnsNo return value |
ExampleTo unblank all of the initial velocities in model m flagged with f: Velocity.UnblankFlagged(m, f);
|
UnflagAll(Model[Model], flag[Flag]) [static]DescriptionUnsets a defined flag on all of the initial velocities in the model. |
Model that the defined flag for all initial velocities will be unset in
Flag to unset on the initial velocities
ReturnsNo return value |
ExampleTo unset the flag f on all the initial velocities in model m: Velocity.UnflagAll(m, f);
|
Unsketch(redraw (optional)[boolean])DescriptionUnsketches the initial velocity. |
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 velocities and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo unsketch initial velocity v: v.Unsketch();
|
UnsketchAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnsketches all initial velocities. |
Model that all initial velocities will be unblanked in
If model should be redrawn or not after the initial velocities 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().
ReturnsNo return value |
ExampleTo unsketch all initial velocities in model m: Velocity.UnsketchAll(m);
|
UnsketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionUnsketches all flagged initial velocities in the model. |
Model that all initial velocities will be unsketched in
Flag set on the initial velocities that you want to unsketch
If model should be redrawn or not after the initial velocities 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().
ReturnsNo return value |
ExampleTo unsketch all initial velocities flagged with flag in model m: Velocity.UnsketchAll(m, flag);
|
No arguments
ReturnsVelocity object. Return typeVelocity |
ExampleTo check if Velocity property v.example is a parameter by using the Velocity.GetParameter() method: if (v.ViewParameters().GetParameter(v.example) ) do_something...
|
Warning(message[string], details (optional)[string])DescriptionAdds a warning for initial velocity. For more details on checking see the Check class. |
The warning message to give
An optional detailed warning message
ReturnsNo return value |
ExampleTo add a warning message "My custom warning" for initial velocity v: v.Warning("My custom warning");
|
Xrefs()DescriptionReturns the cross references for this initial velocity. |
No arguments
ReturnsXrefs object. Return typeXrefs |
ExampleTo get the cross references for initial velocity v: var xrefs = v.Xrefs();
|
toString()DescriptionCreates a string containing the initial velocity data in keyword format. Note that this contains the keyword header and the keyword cards. See also Velocity.Keyword() and Velocity.KeywordCards(). |
No arguments
Returnsstring Return typeString |
ExampleTo get data for velocity i in keyword format var s = i.toString();
|