The ElementDeath class gives you access to define element death 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 | Box restricting element deletion |
| cid | integer | Coordinate ID for transforming boxid. |
| eid | integer | Element ID or element set ID. The sid property is an alternative name for this. |
| exists (read only) | logical | true if element death exists, false if referred to but not defined. |
| idgrp | integer | Group ID for simultaneous deletion. |
| include | integer | The Include file number that the element death is in. |
| inout | logical | If true, Ansys LS-DYNA deletes elements outside box, otherwise inside box. |
| model (read only) | integer | The Model number that the element death is in. |
| option | constant | ElementDeath option. Can be ElementDeath.SOLID, ElementDeath.SOLID_SET, ElementDeath.BEAM, ElementDeath.BEAM_SET, ElementDeath.SHELL, ElementDeath.SHELL_SET, ElementDeath.THICK_SHELL or ElementDeath.THICK_SHELL_SET. The type property is an alternative name for this. |
| percent | real | Deletion percentage. |
| sid | integer | Element ID or element set ID. The eid property is an alternative name for this. |
| time | real | Deletion time for elimination |
| title | string | ElementDeath title |
| type | constant | ElementDeath option. Can be ElementDeath.SOLID, ElementDeath.SOLID_SET, ElementDeath.BEAM, ElementDeath.BEAM_SET, ElementDeath.SHELL, ElementDeath.SHELL_SET, ElementDeath.THICK_SHELL or ElementDeath.THICK_SHELL_SET The option property is an alternative name for this. |
Detailed DescriptionThe ElementDeath class allows you to create, modify, edit and manipulate element death cards. See the documentation below for more details. |
Constructornew ElementDeath(Model[Model], type[string], eid/sid[integer])DescriptionCreate a new ElementDeath object. |
Model that element death will be created in
ElementDeath type. Can be ElementDeath.SOLID, ElementDeath.SOLID_SET, ElementDeath.BEAM, ElementDeath.BEAM_SET, ElementDeath.SHELL, ElementDeath.SHELL_SET, ElementDeath.THICK_SHELL or ElementDeath.THICK_SHELL_SET
Element or element set ID
ReturnsElementDeath object Return typeElementDeath |
ExampleTo create a new element death in model m with option BEAM_SET and sid 100 var ed = new ElementDeath(m, ElementDeath.BEAM_SET, 100);
|
Details of functionsAssociateComment(Comment[Comment])DescriptionAssociates a comment with a element death. |
Comment that will be attached to the element death
ReturnsNo return value |
ExampleTo associate comment c to the element death ed: ed.AssociateComment(c);
|
Browse(modal (optional)[boolean])DescriptionStarts an edit panel in Browse mode. |
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.
Returnsno return value |
ExampleTo Browse element death ed: ed.Browse();
|
ClearFlag(flag[Flag])DescriptionClears a flag on the element death. |
Flag to clear on the element death
ReturnsNo return value |
ExampleTo clear flag f for element death ed: ed.ClearFlag(f);
|
Copy(range (optional)[boolean])DescriptionCopies the element death. The target include of the copied element death 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().
ReturnsElementDeath object Return typeElementDeath |
ExampleTo copy element death ed into element death z: var z = ed.Copy();
|
Create(Model[Model], modal (optional)[boolean]) [static]DescriptionStarts an interactive editing panel to create a element death |
Model that the element death will be created in.
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.
ReturnsElementDeath object (or null if not made). Return typeElementDeath |
ExampleTo start creating a element death in model m: var ed = ElementDeath.Create(m);
|
DetachComment(Comment[Comment])DescriptionDetaches a comment from a element death. |
Comment that will be detached from the element death
ReturnsNo return value |
ExampleTo detach comment c from the element death ed: ed.DetachComment(c);
|
Edit(modal (optional)[boolean])DescriptionStarts an interactive editing panel. |
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.
Returnsno return value |
ExampleTo Edit element death ed: ed.Edit();
|
Error(message[string], details (optional)[string])DescriptionAdds an error for element death. 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 element death ed: ed.Error("My custom error");
|
First(Model[Model]) [static]DescriptionReturns the first element death in the model. |
Model to get first element death in
ReturnsElementDeath object (or null if there are no element deaths in the model). Return typeElementDeath |
ExampleTo get the first element death in model m: var ed = ElementDeath.First(m);
|
FlagAll(Model[Model], flag[Flag]) [static]DescriptionFlags all of the element deaths in the model with a defined flag. |
Model that all element deaths will be flagged in
Flag to set on the element deaths
ReturnsNo return value |
ExampleTo flag all of the element deaths with flag f in model m: ElementDeath.FlagAll(m, f);
|
Flagged(flag[Flag])DescriptionChecks if the element death is flagged or not. |
Flag to test on the element death
Returnstrue if flagged, false if not. Return typeBoolean |
ExampleTo check if element death ed has flag f set on it: if (ed.Flagged(f) ) do_something...
|
ForEach(Model[Model], func[function], extra (optional)[any]) [static]DescriptionCalls a function for each element death in the model. |
Model that all element deaths are in
Function to call for each element death
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 ElementDeath objects or properties for all of the element deaths in a model in PRIMER. If the optional property argument is not given then an array of ElementDeath objects is returned. If the property argument is given, that property value for each element death is returned in the array instead of a ElementDeath object |
Model to get element deaths from
Name for property to get for all element deaths in the model
ReturnsArray of ElementDeath objects or properties Return typeArray |
GetComments()DescriptionExtracts the comments associated to a element death. |
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 element death ed: var comm_array = ed.GetComments();
|
GetFlagged(Model[Model], flag[Flag], property (optional)[string]) [static]DescriptionReturns an array of ElementDeath objects for all of the flagged element deaths in a model in PRIMER If the optional property argument is not given then an array of ElementDeath objects is returned. If the property argument is given, then that property value for each element death is returned in the array instead of a ElementDeath object |
Model to get element deaths from
Flag set on the element deaths that you want to retrieve
Name for property to get for all flagged element deaths in the model
ReturnsArray of ElementDeath objects or properties Return typeArray |
GetFromID(Model[Model], number[integer]) [static]DescriptionReturns the ElementDeath object for a element death ID. |
Model to find the element death in
number of the element death you want the ElementDeath object for
ReturnsElementDeath object (or null if element death does not exist). Return typeElementDeath |
ExampleTo get the ElementDeath object for element death 100 in model m var ed = ElementDeath.GetFromID(m, 100);
|
GetParameter(prop[string])DescriptionChecks if a ElementDeath 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 ElementDeath.ViewParameters() method and 'method chaining' (see the examples below). |
element death property to get parameter for
ReturnsParameter object if property is a parameter, null if not. Return typeParameter |
Keyword()DescriptionReturns the keyword for this element death (*DEFINE_ELEMENT_DEATH). Note that a carriage return is not added. See also ElementDeath.KeywordCards() |
No arguments
Returnsstring containing the keyword. Return typeString |
ExampleTo get the keyword for element death ed: var key = ed.Keyword();
|
KeywordCards()DescriptionReturns the keyword cards for the element death. Note that a carriage return is not added. See also ElementDeath.Keyword() |
No arguments
Returnsstring containing the cards. Return typeString |
ExampleTo get the cards for element death ed: var cards = ed.KeywordCards();
|
Last(Model[Model]) [static]DescriptionReturns the last element death in the model. |
Model to get last element death in
ReturnsElementDeath object (or null if there are no element deaths in the model). Return typeElementDeath |
ExampleTo get the last element death in model m: var ed = ElementDeath.Last(m);
|
Next()DescriptionReturns the next element death in the model. |
No arguments
ReturnsElementDeath object (or null if there are no more element deaths in the model). Return typeElementDeath |
ExampleTo get the element death in model m after element death ed: var ed = ed.Next();
|
Previous()DescriptionReturns the previous element death in the model. |
No arguments
ReturnsElementDeath object (or null if there are no more element deaths in the model). Return typeElementDeath |
ExampleTo get the element death in model m before element death ed: var ed = ed.Previous();
|
Select(flag[Flag], prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean]) [static]DescriptionAllows the user to select element deaths using standard PRIMER object menus. |
Flag to use when selecting element deaths
Text to display as a prompt to the user
If the argument is a Model then only element deaths from that model can be selected. If the argument is a Flag then only element deaths that are flagged with limit can be selected (limit should be different to flag). If omitted, or null, any element deaths 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 element deaths selected or null if menu cancelled Return typeNumber |
SetFlag(flag[Flag])DescriptionSets a flag on the element death. |
Flag to set on the element death
ReturnsNo return value |
ExampleTo set flag f for element death ed: ed.SetFlag(f);
|
Total(Model[Model], exists (optional)[boolean]) [static]DescriptionReturns the total number of element deaths in the model. |
Model to get total for
true if only existing element deaths should be counted. If false or omitted referenced but undefined element deaths will also be included in the total.
Returnsnumber of element deaths Return typeNumber |
ExampleTo get the total number of element deaths in model m: var total = ElementDeath.Total(m);
|
UnflagAll(Model[Model], flag[Flag]) [static]DescriptionUnsets a defined flag on all of the element deaths in the model. |
Model that the defined flag for all element deaths will be unset in
Flag to unset on the element deaths
ReturnsNo return value |
ExampleTo unset the flag f on all the element deaths in model m: ElementDeath.UnflagAll(m, f);
|
No arguments
ReturnsElementDeath object. Return typeElementDeath |
ExampleTo check if ElementDeath property ed.example is a parameter by using the ElementDeath.GetParameter() method: if (ed.ViewParameters().GetParameter(ed.example) ) do_something...
|
Warning(message[string], details (optional)[string])DescriptionAdds a warning for element death. 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 element death ed: ed.Warning("My custom warning");
|
Xrefs()DescriptionReturns the cross references for this element death. |
No arguments
ReturnsXrefs object. Return typeXrefs |
ExampleTo get the cross references for element death ed: var xrefs = ed.Xrefs();
|
toString()DescriptionCreates a string containing the element death data in keyword format. Note that this contains the keyword header and the keyword cards. See also ElementDeath.Keyword() and ElementDeath.KeywordCards(). |
No arguments
Returnsstring Return typeString |
ExampleTo get data for element death ed in keyword format var s = ed.toString();
|