The History class gives you access to database history 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 |
| cid | integer | Coordinate system ID for _LOCAL |
| exists (read only) | logical | true if database history exists, false if referred to but not defined. |
| heading | string | Optional heading |
| hfo | integer | High frequency flag for _LOCAL |
| id | integer | ID of the item |
| include | integer | The Include file number that the database history is in. |
| local | logical | Turns _LOCAL on or off |
| model | integer | The Model number that the database history is in. |
| ref | integer | Output reference for _LOCAL |
| type (read only) | constant | The database history type. Can be History.ACOUSTIC or History.BEAM or History.BEAM_SET or History.DISCRETE or History.DISCRETE_SET or History.NODE or History.NODE_SET or History.SEATBELT or History.SHELL or History.SHELL_SET or History.SOLID or History.SOLID_SET or History.SPH or History.SPH_SET or History.TSHELL or History.TSHELL_SET. |
Detailed DescriptionThe History class allows you to create, modify, edit and manipulate database history cards. See the documentation below for more details. |
Constructornew History(Model[Model], type[constant], id[integer], heading (optional)[string])DescriptionCreate a new History object. |
Model that database history will be created in
Entity type
ID of the item
Optional heading
ReturnsHistory object Return typeHistory |
ExampleTo create a new Database history on NODE 500 called "test history": var c = new History(m, History.NODE, 500, "test history");
|
Details of functionsBlankAll(Model[Model], type (optional)[constant], redraw (optional)[boolean]) [static]DescriptionBlanks all of the database histories in the model. |
Model that all database histories will be blanked in
The database history type. Can be History.ACOUSTIC or History.BEAM or History.BEAM_SET or History.DISCRETE or History.DISCRETE_SET or History.NODE or History.NODE_SET or History.SEATBELT or History.SHELL or History.SHELL_SET or History.SOLID or History.SOLID_SET or History.SPH or History.SPH_SET or History.TSHELL or History.TSHELL_SET or History.ALL_TYPES. If omitted, applied to all database history types.
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 database histories in model m: History.BlankAll(m);
|
BlankFlagged(Model[Model], flag[Flag], type (optional)[constant], redraw (optional)[boolean]) [static]DescriptionBlanks all of the flagged database histories in the model. |
Model that all the flagged database histories will be blanked in
Flag set on the database histories that you want to blank
The database history type. Can be History.ACOUSTIC or History.BEAM or History.BEAM_SET or History.DISCRETE or History.DISCRETE_SET or History.NODE or History.NODE_SET or History.SEATBELT or History.SHELL or History.SHELL_SET or History.SOLID or History.SOLID_SET or History.SPH or History.SPH_SET or History.TSHELL or History.TSHELL_SET or History.ALL_TYPES. If omitted, applied to all database history types.
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 database histories in model m flagged with f: History.BlankFlagged(m, f);
|
Blanked()DescriptionChecks if the database history is blanked or not. |
No arguments
Returnstrue if blanked, false if not. Return typeBoolean |
ExampleTo check if database history c is blanked: if (c.Blanked() ) do_something...
|
ClearFlag(flag[Flag])DescriptionClears a flag on the database history. |
Flag to clear on the database history
ReturnsNo return value |
ExampleTo clear flag f for database history c: c.ClearFlag(f);
|
Create(Model[Model], type[constant], modal (optional)[boolean]) [static]DescriptionStarts an interactive editing panel to create a database history. |
Model that the database history will be created in
The database history type. Can be History.ACOUSTIC or History.BEAM or History.BEAM_SET or History.DISCRETE or History.DISCRETE_SET or History.NODE or History.NODE_SET or History.SEATBELT or History.SHELL or History.SHELL_SET or History.SOLID or History.SOLID_SET or History.SPH or History.SPH_SET or History.TSHELL or History.TSHELL_SET.
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.
ReturnsHistory object (or null if not made) Return typeHistory |
ExampleTo start creating a history in model m: var c = History.Create(m);
|
Edit(modal (optional)[boolean])DescriptionStarts an interactive editing panel to edit the database history. |
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 database history c: c.Edit();
|
First(Model[Model], type (optional)[constant]) [static]DescriptionReturns the first database history in the model. |
Model to get first database history in
The database history type. Can be History.ACOUSTIC or History.BEAM or History.BEAM_SET or History.DISCRETE or History.DISCRETE_SET or History.NODE or History.NODE_SET or History.SEATBELT or History.SHELL or History.SHELL_SET or History.SOLID or History.SOLID_SET or History.SPH or History.SPH_SET or History.TSHELL or History.TSHELL_SET or History.ALL_TYPES. If omitted, applied to all database history types.
ReturnsHistory object (or null if there are no database histories in the model). Return typeHistory |
ExampleTo get the first database history in model m: var history = History.First(m);
|
FlagAll(Model[Model], flag[Flag], type (optional)[constant]) [static]DescriptionFlags all of the database histories in the model with a defined flag. |
Model that all database histories will be flagged in
Flag to set on the database histories
The database history type. Can be History.ACOUSTIC or History.BEAM or History.BEAM_SET or History.DISCRETE or History.DISCRETE_SET or History.NODE or History.NODE_SET or History.SEATBELT or History.SHELL or History.SHELL_SET or History.SOLID or History.SOLID_SET or History.SPH or History.SPH_SET or History.TSHELL or History.TSHELL_SET or History.ALL_TYPES. If omitted, applied to all database history types.
ReturnsNo return value |
ExampleTo flag all of the database histories with flag f in model m: History.FlagAll(m, f);
|
Flagged(flag[Flag])DescriptionChecks if the database history is flagged or not. |
Flag to clear on the database history
Returnstrue if flagged, false if not. Return typeBoolean |
ExampleTo check if database history c has flag f set on it: if (c.Flagged(f) ) do_something...
|
GetAll(Model[Model], type (optional)[constant]) [static]DescriptionReturns an array of History objects for all of the database histories in a models in PRIMER |
Model to get database histories from
The database history type. Can be History.ACOUSTIC or History.BEAM or History.BEAM_SET or History.DISCRETE or History.DISCRETE_SET or History.NODE or History.NODE_SET or History.SEATBELT or History.SHELL or History.SHELL_SET or History.SOLID or History.SOLID_SET or History.SPH or History.SPH_SET or History.TSHELL or History.TSHELL_SET or History.ALL_TYPES. If omitted, applied to all database history types.
ReturnsArray of History objects Return typeArray |
ExampleTo make an array of History objects for all of the database histories in model m var database history = History.GetAll(m);
|
GetFromID(Model[Model], database history number[integer]) [static]DescriptionReturns the History object for a database history ID. |
Model to find the database history in
number of the database history you want the History object for
ReturnsHistory object (or null if database history does not exist). Return typeHistory |
ExampleTo get the History object for database history 100 in model m var database history = History.GetFromID(m, 100);
|
Keyword()DescriptionReturns the keyword for this database history (*DATABASE_HISTORY). Note that a carriage return is not added. See also History.KeywordCards() |
No arguments
Returnsstring containing the keyword. Return typeString |
ExampleTo get the keyword for database history c: var key = c.Keyword();
|
KeywordCards()DescriptionReturns the keyword cards for the database history. Note that a carriage return is not added. See also History.Keyword() |
No arguments
Returnsstring containing the cards. Return typeString |
ExampleTo get the cards for database history c: var cards = c.KeywordCards();
|
Last(Model[Model], type (optional)[constant]) [static]DescriptionReturns the last database history in the model. |
Model to get last database history in
The database history type. Can be History.ACOUSTIC or History.BEAM or History.BEAM_SET or History.DISCRETE or History.DISCRETE_SET or History.NODE or History.NODE_SET or History.SEATBELT or History.SHELL or History.SHELL_SET or History.SOLID or History.SOLID_SET or History.SPH or History.SPH_SET or History.TSHELL or History.TSHELL_SET or History.ALL_TYPES. If omitted, applied to all database history types.
ReturnsHistory object (or null if there are no database histories in the model). Return typeHistory |
ExampleTo get the last database history in model m: var database history = History.Last(m);
|
Next()DescriptionReturns the next database history in the model. |
No arguments
ReturnsHistory object (or null if there are no more database histories in the model). Return typeHistory |
ExampleTo get the database history in model m after database history c: var database history = c.Next();
|
Pick(prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean]) [static]DescriptionAllows the user to pick a database history. |
Text to display as a prompt to the user
If the argument is a Model then only database histories from that model can be picked. If the argument is a Flag then only database histories that are flagged with limit can be selected. If omitted, or null, any database histories 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.
ReturnsHistory object (or null if not picked) Return typeHistory |
ExampleTo pick a database history from model m giving the prompt 'Pick database history from screen': var database history = History.Pick('Pick database history from screen', m);
|
Previous()DescriptionReturns the previous database history in the model. |
No arguments
ReturnsHistory object (or null if there are no more database histories in the model). Return typeHistory |
ExampleTo get the database history in model m before this one: var history = history.Previous();
|
Select(flag[Flag], prompt[string], limit (optional)[Model or Flag], modal (optional)[boolean]) [static]DescriptionAllows the user to select database histories using standard PRIMER object menus. |
Flag to use when selecting database histories
Text to display as a prompt to the user
If the argument is a Model then only database histories from that model can be selected. If the argument is a Flag then only database histories that are flagged with limit can be selected (limit should be different to flag). If omitted, or null, any database histories from any model can be selected.
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 items selected or null if menu cancelled Return typeNumber |
ExampleTo select database histories from model m, flagging those selected which flag f, giving the prompt 'Select database histories': History.Select(f, 'Select database histories', m);
|
SetFlag(flag[Flag])DescriptionSets a flag on the database history. |
Flag to set on the database history
ReturnsNo return value |
ExampleTo set flag f for database history c: c.SetFlag(f);
|
Sketch(redraw (optional)[boolean])DescriptionSketches the database history. The database history will be sketched until you either call History.Unsketch(), History.UnsketchAll(), Model.UnsketchAll(), or delete the model |
If model should be redrawn or not after the database history is sketched. If omitted redraw is true. If you want to sketch several database histories and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo sketch database history c: c.Sketch();
|
SketchFlagged(Model[Model], flag[Flag], type (optional)[constant], redraw (optional)[boolean]) [static]DescriptionSketches all of the flagged database histories in the model. |
Model that all the flagged database histories will be sketched in
Flag set on the database histories that you want to sketch
The database history type. Can be History.ACOUSTIC or History.BEAM or History.BEAM_SET or History.DISCRETE or History.DISCRETE_SET or History.NODE or History.NODE_SET or History.SEATBELT or History.SHELL or History.SHELL_SET or History.SOLID or History.SOLID_SET or History.SPH or History.SPH_SET or History.TSHELL or History.TSHELL_SET or History.ALL_TYPES. If omitted, applied to all database history types.
If model should be redrawn or not. If omitted redraw is true. If you want to do several (un)sketches 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 sketch all of the database histories of type SHELL_SET in model m flagged with f: History.SketchFlagged(m, f, History.SHELL_SET);
|
UnblankAll(Model[Model], redraw (optional)[boolean], type (optional)[constant]) [static]DescriptionUnblanks all of the database histories in the model. |
Model that all database histories 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().
The database history type. Can be History.ACOUSTIC or History.BEAM or History.BEAM_SET or History.DISCRETE or History.DISCRETE_SET or History.NODE or History.NODE_SET or History.SEATBELT or History.SHELL or History.SHELL_SET or History.SOLID or History.SOLID_SET or History.SPH or History.SPH_SET or History.TSHELL or History.TSHELL_SET or History.ALL_TYPES. If omitted, applied to all database history types.
ReturnsNo return value |
ExampleTo unblank all of the database histories in model m: History.UnblankAll(m);
|
UnblankFlagged(Model[Model], flag[Flag], type (optional)[constant], redraw (optional)[boolean]) [static]DescriptionUnblanks all of the flagged database histories in the model. |
Model that the flagged database histories will be unblanked in
Flag set on the database histories that you want to unblank
The database history type. Can be History.ACOUSTIC or History.BEAM or History.BEAM_SET or History.DISCRETE or History.DISCRETE_SET or History.NODE or History.NODE_SET or History.SEATBELT or History.SHELL or History.SHELL_SET or History.SOLID or History.SOLID_SET or History.SPH or History.SPH_SET or History.TSHELL or History.TSHELL_SET or History.ALL_TYPES. If omitted, applied to all database history types.
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 database histories in model m flagged with f: History.UnblankFlagged(m, f);
|
UnflagAll(Model[Model], flag[Flag], type (optional)[constant]) [static]DescriptionUnsets a defined flag on all of the database histories in the model. |
Model that the defined flag for all database histories will be unset in
Flag to unset on the database histories
The database history type. Can be History.ACOUSTIC or History.BEAM or History.BEAM_SET or History.DISCRETE or History.DISCRETE_SET or History.NODE or History.NODE_SET or History.SEATBELT or History.SHELL or History.SHELL_SET or History.SOLID or History.SOLID_SET or History.SPH or History.SPH_SET or History.TSHELL or History.TSHELL_SET or History.ALL_TYPES. If omitted, applied to all database history types.
ReturnsNo return value |
ExampleTo unset the flag f on all the database histories in model m: History.UnflagAll(m, f);
|
Unsketch(redraw (optional)[boolean])DescriptionUnsketches the database history. |
If model should be redrawn or not after the database history is unsketched. If omitted redraw is true. If you want to unsketch several database histories and only redraw after the last one then use false for redraw and call View.Redraw().
ReturnsNo return value |
ExampleTo unsketch database history c: c.Unsketch();
|
UnsketchAll(Model[Model], redraw (optional)[boolean]) [static]DescriptionUnsketches all database histories. |
Model that all database histories will be unblanked in
If model should be redrawn or not after the database histories 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 database histories in model m: History.UnsketchAll(m);
|
UnsketchFlagged(Model[Model], flag[Flag], type (optional)[constant], redraw (optional)[boolean]) [static]DescriptionUnsketches all flagged database histories. |
Model that all database histories will be unblanked in
Flag set on the database histories that you want to sketch
The database history type. Can be History.ACOUSTIC or History.BEAM or History.BEAM_SET or History.DISCRETE or History.DISCRETE_SET or History.NODE or History.NODE_SET or History.SEATBELT or History.SHELL or History.SHELL_SET or History.SOLID or History.SOLID_SET or History.SPH or History.SPH_SET or History.TSHELL or History.TSHELL_SET or History.ALL_TYPES. If omitted, applied to all database history types.
If model should be redrawn or not after the database histories 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 of the database histories in model m flagged with f: History.UnsketchFlagged(m, f);
|
Xrefs()DescriptionReturns the cross references for this database history. |
No arguments
ReturnsXrefs object. Return typeXrefs |
ExampleTo get the cross references for this database history: var xrefs = c.Xrefs();
|
toString()DescriptionCreates a string containing the database history data in keyword format. Note that this contains the keyword header and the keyword cards. See also History.Keyword() and History.KeywordCards(). |
No arguments
Returnsstring Return typeString |
ExampleTo get data for database history c in keyword format var s = c.toString();
|