The DampingPartMass class gives you access to define damping part mass 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 | Description |
| DampingPartMass.PART | PART is *DAMPING_PART_MASS. |
| DampingPartMass.SET | SET is *DAMPING_PART_MASS_SET. |
| Name | Type | Description |
| exists (read only) | logical | true if damping part mass exists, false if referred to but not defined. |
| flag | integer | Flag for scale factors |
| id | integer | Part/part set id |
| include | integer | The Include file number that the damping part mass is in. |
| lcid | integer | LC: Damping vs time |
| model (read only) | integer | The Model number that the damping part mass is in. |
| sf | real | Scale factor on loadcurve |
| srx | real | Rotational x scale factor |
| sry | real | Rotational y scale factor |
| srz | real | Rotational z scale factor |
| stx | real | Translational x scale factor |
| sty | real | Translational y scale factor |
| stz | real | Translational z scale factor |
| type | constant | The DampingPartMass type. Can be: |
Detailed DescriptionThe DampingPartMass class allows you to create, modify, edit and manipulate damping_part_mass cards. See the documentation below for more details. |
Constructornew DampingPartMass(Model[Model], type[constant], id[integer], lcid[integer], sf (optional)[real], flag (optional)[integer], stx (optional)[real], sty (optional)[real], stz (optional)[real], srx (optional)[real], sry (optional)[real], srz (optional)[real])DescriptionCreate a new DampingPartMass object for *DAMPING_PART_MASS. |
Model that damping part mass will be created in
Damping part mass type. Can be DampingPartMass.PART or DampingPartMass.SET.
Part/part set id
LC: Damping vs time
Scale factor on loadcurve
Flag for scale factors
Translational x scale factor
Translational y scale factor
Translational z scale factor
Rotational x scale factor
Rotational y scale factor
Rotational z scale factor
ReturnsDampingPartMass object Return typeDampingPartMass |
ExampleTo create a new damping part mass (of type PART) in model m with id, lcid, sf, flag set to 11, 12, 3.5, 1 respectively: var pm = new DampingPartMass(m, DampingPartMass.PART, 11, 12, 3.5, 1);
|
Details of functionsAssociateComment(Comment[Comment])DescriptionAssociates a comment with a damping part mass. |
Comment that will be attached to the damping part mass
ReturnsNo return value |
ExampleTo associate comment c to the damping part mass pm: pm.AssociateComment(c);
|
Blank()DescriptionBlanks the damping part mass |
No arguments
ReturnsNo return value |
ExampleTo blank damping part mass pm: pm.Blank();
|
BlankAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionBlanks all of the damping part masss in the model. |
Model that all damping part masss 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 damping part masss in model m: DampingPartMass.BlankAll(m);
|
BlankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionBlanks all of the flagged damping part masss in the model. |
Model that all the flagged damping part masss will be blanked in
Flag set on the damping part masss 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 damping part masss in model m flagged with f: DampingPartMass.BlankFlagged(m, f);
|
Blanked()DescriptionChecks if the damping part mass is blanked or not. |
No arguments
Returnstrue if blanked, false if not. Return typeBoolean |
ExampleTo check if damping part mass pm is blanked: if (pm.Blanked() ) do_something...
|
ClearFlag(flag[Flag])DescriptionClears a flag on the damping part mass. |
Flag to clear on the damping part mass
ReturnsNo return value |
ExampleTo clear flag f for damping part mass pm: pm.ClearFlag(f);
|
Copy(range (optional)[boolean])DescriptionCopies the damping part mass. The target include of the copied damping part mass 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().
ReturnsDampingPartMass object Return typeDampingPartMass |
ExampleTo copy damping part mass pm into damping part mass z: var z = pm.Copy();
|
DetachComment(Comment[Comment])DescriptionDetaches a comment from a damping part mass. |
Comment that will be detached from the damping part mass
ReturnsNo return value |
ExampleTo detach comment c from the damping part mass pm: pm.DetachComment(c);
|
Error(message[string], details (optional)[string])DescriptionAdds an error for damping part mass. 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 damping part mass pm: pm.Error("My custom error");
|
First(Model[Model]) [static]DescriptionReturns the first damping part mass in the model. |
Model to get first damping part mass in
ReturnsDampingPartMass object (or null if there are no damping part masss in the model). Return typeDampingPartMass |
ExampleTo get the first damping part mass in model m: var pm = DampingPartMass.First(m);
|
FlagAll(Model[Model], flag[Flag]) [static]DescriptionFlags all of the damping part masss in the model with a defined flag. |
Model that all damping part masss will be flagged in
Flag to set on the damping part masss
ReturnsNo return value |
ExampleTo flag all of the damping part masss with flag f in model m: DampingPartMass.FlagAll(m, f);
|
Flagged(flag[Flag])DescriptionChecks if the damping part mass is flagged or not. |
Flag to test on the damping part mass
Returnstrue if flagged, false if not. Return typeBoolean |
ExampleTo check if damping part mass pm has flag f set on it: if (pm.Flagged(f) ) do_something...
|
ForEach(Model[Model], func[function], extra (optional)[any]) [static]DescriptionCalls a function for each damping part mass in the model. |
Model that all damping part masss are in
Function to call for each damping part mass
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 DampingPartMass objects or properties for all of the damping part masss in a model in PRIMER. If the optional property argument is not given then an array of DampingPartMass objects is returned. If the property argument is given, that property value for each damping part mass is returned in the array instead of a DampingPartMass object |
Model to get damping part masss from
Name for property to get for all damping part masss in the model
ReturnsArray of DampingPartMass objects or properties Return typeArray |
GetComments()DescriptionExtracts the comments associated to a damping part mass. |
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 damping part mass pm: var comm_array = pm.GetComments();
|
GetFlagged(Model[Model], flag[Flag], property (optional)[string]) [static]DescriptionReturns an array of DampingPartMass objects for all of the flagged damping part masss in a model in PRIMER If the optional property argument is not given then an array of DampingPartMass objects is returned. If the property argument is given, then that property value for each damping part mass is returned in the array instead of a DampingPartMass object |
Model to get damping part masss from
Flag set on the damping part masss that you want to retrieve
Name for property to get for all flagged damping part masss in the model
ReturnsArray of DampingPartMass objects or properties Return typeArray |
GetFromID(Model[Model], number[integer]) [static]DescriptionReturns the DampingPartMass object for a damping part mass ID. |
Model to find the damping part mass in
number of the damping part mass you want the DampingPartMass object for
ReturnsDampingPartMass object (or null if damping part mass does not exist). Return typeDampingPartMass |
ExampleTo get the DampingPartMass object for damping part mass 100 in model m var pm = DampingPartMass.GetFromID(m, 100);
|
GetParameter(prop[string])DescriptionChecks if a DampingPartMass 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 DampingPartMass.ViewParameters() method and 'method chaining' (see the examples below). |
damping part mass property to get parameter for
ReturnsParameter object if property is a parameter, null if not. Return typeParameter |
Keyword()DescriptionReturns the keyword for this damping part mass (*DAMPING_PART_MASS). Note that a carriage return is not added. See also DampingPartMass.KeywordCards() |
No arguments
Returnsstring containing the keyword. Return typeString |
ExampleTo get the keyword for damping part mass m: var key = fr.Keyword();
|
KeywordCards()DescriptionReturns the keyword cards for the damping part mass. Note that a carriage return is not added. See also DampingPartMass.Keyword() |
No arguments
Returnsstring containing the cards. Return typeString |
ExampleTo get the cards for damping part mass fr: var cards = fr.KeywordCards();
|
Last(Model[Model]) [static]DescriptionReturns the last damping part mass in the model. |
Model to get last damping part mass in
ReturnsDampingPartMass object (or null if there are no damping part masss in the model). Return typeDampingPartMass |
ExampleTo get the last damping part mass in model m: var pm = DampingPartMass.Last(m);
|
Next()DescriptionReturns the next damping part mass in the model. |
No arguments
ReturnsDampingPartMass object (or null if there are no more damping part masss in the model). Return typeDampingPartMass |
ExampleTo get the damping part mass in model m after damping part mass pm: var pm = pm.Next();
|
Pick(prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean], button text (optional)[string]) [static]DescriptionAllows the user to pick a damping part mass. |
Text to display as a prompt to the user
If the argument is a Model then only damping part masss from that model can be picked. If the argument is a Flag then only damping part masss that are flagged with limit can be selected. If omitted, or null, any damping part masss 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.
ReturnsDampingPartMass object (or null if not picked) Return typeDampingPartMass |
ExampleTo pick a damping part mass from model m giving the prompt 'Pick damping part mass from screen': var pm = DampingPartMass.Pick('Pick damping part mass from screen', m);
|
Previous()DescriptionReturns the previous damping part mass in the model. |
No arguments
ReturnsDampingPartMass object (or null if there are no more damping part masss in the model). Return typeDampingPartMass |
ExampleTo get the damping part mass in model m before damping part mass pm: var pm = pm.Previous();
|
Select(flag[Flag], prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean]) [static]DescriptionAllows the user to select damping part masss using standard PRIMER object menus. |
Flag to use when selecting damping part masss
Text to display as a prompt to the user
If the argument is a Model then only damping part masss from that model can be selected. If the argument is a Flag then only damping part masss that are flagged with limit can be selected (limit should be different to flag). If omitted, or null, any damping part masss 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 damping part masss selected or null if menu cancelled Return typeNumber |
SetFlag(flag[Flag])DescriptionSets a flag on the damping part mass. |
Flag to set on the damping part mass
ReturnsNo return value |
ExampleTo set flag f for damping part mass pm: pm.SetFlag(f);
|
Sketch(redraw (optional)[boolean])DescriptionSketches the damping part mass. The damping part mass will be sketched until you either call DampingPartMass.Unsketch(), DampingPartMass.UnsketchAll(), Model.UnsketchAll(), or delete the model |
If model should be redrawn or not after the damping part mass is sketched. If omitted redraw is true. If you want to sketch several damping part masss and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo sketch damping part mass pm: pm.Sketch();
|
SketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionSketches all of the flagged damping part masss in the model. The damping part masss will be sketched until you either call DampingPartMass.Unsketch(), DampingPartMass.UnsketchFlagged(), Model.UnsketchAll(), or delete the model |
Model that all the flagged damping part masss will be sketched in
Flag set on the damping part masss that you want to sketch
If model should be redrawn or not after the damping part masss are sketched. If omitted redraw is true. If you want to sketch flagged damping part masss several times and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo sketch all damping part masss flagged with flag in model m: DampingPartMass.SketchFlagged(m, flag);
|
Total(Model[Model], exists (optional)[boolean]) [static]DescriptionReturns the total number of damping part masss in the model. |
Model to get total for
true if only existing damping part masss should be counted. If false or omitted referenced but undefined damping part masss will also be included in the total.
Returnsnumber of damping part masss Return typeNumber |
ExampleTo get the total number of damping part masss in model m: var total = DampingPartMass.Total(m);
|
Unblank()DescriptionUnblanks the damping part mass |
No arguments
ReturnsNo return value |
ExampleTo unblank damping part mass pm: pm.Unblank();
|
UnblankAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the damping part masss in the model. |
Model that all damping part masss 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 damping part masss in model m: DampingPartMass.UnblankAll(m);
|
UnblankFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the flagged damping part masss in the model. |
Model that the flagged damping part masss will be unblanked in
Flag set on the damping part masss 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 damping part masss in model m flagged with f: DampingPartMass.UnblankFlagged(m, f);
|
UnflagAll(Model[Model], flag[Flag]) [static]DescriptionUnsets a defined flag on all of the damping part masss in the model. |
Model that the defined flag for all damping part masss will be unset in
Flag to unset on the damping part masss
ReturnsNo return value |
ExampleTo unset the flag f on all the damping part masss in model m: DampingPartMass.UnflagAll(m, f);
|
Unsketch(redraw (optional)[boolean])DescriptionUnsketches the damping part mass. |
If model should be redrawn or not after the damping part mass is unsketched. If omitted redraw is true. If you want to unsketch several damping part masss and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo unsketch damping part mass pm: pm.Unsketch();
|
UnsketchAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnsketches all damping part masss. |
Model that all damping part masss will be unblanked in
If model should be redrawn or not after the damping part masss 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 damping part masss in model m: DampingPartMass.UnsketchAll(m);
|
UnsketchFlagged(Model[Model], flag[Flag], redraw (optional)[boolean]) [static]DescriptionUnsketches all flagged damping part masss in the model. |
Model that all damping part masss will be unsketched in
Flag set on the damping part masss that you want to unsketch
If model should be redrawn or not after the damping part masss 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 damping part masss flagged with flag in model m: DampingPartMass.UnsketchAll(m, flag);
|
No arguments
ReturnsDampingPartMass object. Return typeDampingPartMass |
ExampleTo check if DampingPartMass property pm.example is a parameter by using the DampingPartMass.GetParameter() method: if (pm.ViewParameters().GetParameter(pm.example) ) do_something...
|
Warning(message[string], details (optional)[string])DescriptionAdds a warning for damping part mass. 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 damping part mass pm: pm.Warning("My custom warning");
|
Xrefs()DescriptionReturns the cross references for this damping part mass. |
No arguments
ReturnsXrefs object. Return typeXrefs |
ExampleTo get the cross references for damping part mass pm: var xrefs = pm.Xrefs();
|
toString()DescriptionCreates a string containing the damping part mass data in keyword format. Note that this contains the keyword header and the keyword cards. See also DampingPartMass.Keyword() and DampingPartMass.KeywordCards(). |
No arguments
Returnsstring Return typeString |
ExampleTo get data for damping part mass pm in keyword format var s = fr.toString();
|