History class

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:

Class functions

Member functions

History constants

Name Description
History.ACOUSTIC ACOUSTIC is *DATABASE_HISTORY_ACOUSTIC.
History.ALL_TYPES All *DATABASE_HISTORY_ types.
History.BEAM BEAM is *DATABASE_HISTORY_BEAM.
History.BEAM_SET BEAM_SET is *DATABASE_HISTORY_BEAM_SET.
History.DISCRETE DISCRETE is *DATABASE_HISTORY_DISCRETE.
History.DISCRETE_SET DISCRETE_SET is *DATABASE_HISTORY_DISCRETE_SET.
History.NODE NODE is *DATABASE_HISTORY_NODE.
History.NODE_SET NODE_SET is *DATABASE_HISTORY_NODE_SET.
History.SEATBELT SEATBELT is *DATABASE_HISTORY_SEATBELT.
History.SHELL SHELL is *DATABASE_HISTORY_SHELL.
History.SHELL_SET SHELL_SET is *DATABASE_HISTORY_SHELL_SET.
History.SOLID SOLID is *DATABASE_HISTORY_SOLID.
History.SOLID_SET SOLID_SET is *DATABASE_HISTORY_SOLID_SET.
History.SPH SPH is *DATABASE_HISTORY_SPH.
History.SPH_SET SPH_SET is *DATABASE_HISTORY_SPH_SET.
History.TSHELL TSHELL is *DATABASE_HISTORY_TSHELL.
History.TSHELL_SET TSHELL_SET is *DATABASE_HISTORY_TSHELL_SET.

History properties

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 Description

The History class allows you to create, modify, edit and manipulate database history cards. See the documentation below for more details.

Constructor

new History(Model[Model], type[constant], id[integer], heading (optional)[string])

Description

Create a new History object.

Arguments

  • Model (Model)

    Model that database history will be created in

  • type (constant)

    Entity type

  • id (integer)

    ID of the item

  • heading (optional) (string)

    Optional heading

    Returns

    History object

    Return type

    History

    Example

    To create a new Database history on NODE 500 called "test history":

    var c = new History(m, History.NODE, 500, "test history");

    Details of functions

    BlankAll(Model[Model], type (optional)[constant], redraw (optional)[boolean]) [static]

    Description

    Blanks all of the database histories in the model.

    Arguments

  • Model (Model)

    Model that all database histories will be blanked in

  • type (optional) (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 or History.ALL_TYPES. If omitted, applied to all database history types.

  • redraw (optional) (boolean)

    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

    Example

    To blank all of the database histories in model m:

    History.BlankAll(m);


    BlankFlagged(Model[Model], flag[Flag], type (optional)[constant], redraw (optional)[boolean]) [static]

    Description

    Blanks all of the flagged database histories in the model.

    Arguments

  • Model (Model)

    Model that all the flagged database histories will be blanked in

  • flag (Flag)

    Flag set on the database histories that you want to blank

  • type (optional) (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 or History.ALL_TYPES. If omitted, applied to all database history types.

  • redraw (optional) (boolean)

    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

    Example

    To blank all of the database histories in model m flagged with f:

    History.BlankFlagged(m, f);


    Blanked()

    Description

    Checks if the database history is blanked or not.

    Arguments

    No arguments

    Returns

    true if blanked, false if not.

    Return type

    Boolean

    Example

    To check if database history c is blanked:

    if (c.Blanked() ) do_something...


    ClearFlag(flag[Flag])

    Description

    Clears a flag on the database history.

    Arguments

  • flag (Flag)

    Flag to clear on the database history

    Returns

    No return value

    Example

    To clear flag f for database history c:

    c.ClearFlag(f);


    Create(Model[Model], type[constant], modal (optional)[boolean]) [static]

    Description

    Starts an interactive editing panel to create a database history.

    Arguments

  • Model (Model)

    Model that the database history will be created in

  • type (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.

  • modal (optional) (boolean)

    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

    History object (or null if not made)

    Return type

    History

    Example

    To start creating a history in model m:

    var c = History.Create(m);


    Edit(modal (optional)[boolean])

    Description

    Starts an interactive editing panel to edit the database history.

    Arguments

  • modal (optional) (boolean)

    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

    Example

    To edit database history c:

    c.Edit();


    First(Model[Model], type (optional)[constant]) [static]

    Description

    Returns the first database history in the model.

    Arguments

  • Model (Model)

    Model to get first database history in

  • type (optional) (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 or History.ALL_TYPES. If omitted, applied to all database history types.

    Returns

    History object (or null if there are no database histories in the model).

    Return type

    History

    Example

    To get the first database history in model m:

    var history = History.First(m);


    FlagAll(Model[Model], flag[Flag], type (optional)[constant]) [static]

    Description

    Flags all of the database histories in the model with a defined flag.

    Arguments

  • Model (Model)

    Model that all database histories will be flagged in

  • flag (Flag)

    Flag to set on the database histories

  • type (optional) (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 or History.ALL_TYPES. If omitted, applied to all database history types.

    Returns

    No return value

    Example

    To flag all of the database histories with flag f in model m:

    History.FlagAll(m, f);


    Flagged(flag[Flag])

    Description

    Checks if the database history is flagged or not.

    Arguments

  • flag (Flag)

    Flag to clear on the database history

    Returns

    true if flagged, false if not.

    Return type

    Boolean

    Example

    To check if database history c has flag f set on it:

    if (c.Flagged(f) ) do_something...


    GetAll(Model[Model], type (optional)[constant]) [static]

    Description

    Returns an array of History objects for all of the database histories in a models in PRIMER

    Arguments

  • Model (Model)

    Model to get database histories from

  • type (optional) (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 or History.ALL_TYPES. If omitted, applied to all database history types.

    Returns

    Array of History objects

    Return type

    Array

    Example

    To 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]

    Description

    Returns the History object for a database history ID.

    Arguments

  • Model (Model)

    Model to find the database history in

  • database history number (integer)

    number of the database history you want the History object for

    Returns

    History object (or null if database history does not exist).

    Return type

    History

    Example

    To get the History object for database history 100 in model m

    var database history = History.GetFromID(m, 100);


    Keyword()

    Description

    Returns the keyword for this database history (*DATABASE_HISTORY). Note that a carriage return is not added. See also History.KeywordCards()

    Arguments

    No arguments

    Returns

    string containing the keyword.

    Return type

    String

    Example

    To get the keyword for database history c:

    var key = c.Keyword();


    KeywordCards()

    Description

    Returns the keyword cards for the database history. Note that a carriage return is not added. See also History.Keyword()

    Arguments

    No arguments

    Returns

    string containing the cards.

    Return type

    String

    Example

    To get the cards for database history c:

    var cards = c.KeywordCards();


    Last(Model[Model], type (optional)[constant]) [static]

    Description

    Returns the last database history in the model.

    Arguments

  • Model (Model)

    Model to get last database history in

  • type (optional) (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 or History.ALL_TYPES. If omitted, applied to all database history types.

    Returns

    History object (or null if there are no database histories in the model).

    Return type

    History

    Example

    To get the last database history in model m:

    var database history = History.Last(m);


    Next()

    Description

    Returns the next database history in the model.

    Arguments

    No arguments

    Returns

    History object (or null if there are no more database histories in the model).

    Return type

    History

    Example

    To 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]

    Description

    Allows the user to pick a database history.

    Arguments

  • prompt (string)

    Text to display as a prompt to the user

  • limit (optional) (Model or Flag)

    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.

  • modal (optional) (boolean)

    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.

    Returns

    History object (or null if not picked)

    Return type

    History

    Example

    To 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()

    Description

    Returns the previous database history in the model.

    Arguments

    No arguments

    Returns

    History object (or null if there are no more database histories in the model).

    Return type

    History

    Example

    To 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]

    Description

    Allows the user to select database histories using standard PRIMER object menus.

    Arguments

  • flag (Flag)

    Flag to use when selecting database histories

  • prompt (string)

    Text to display as a prompt to the user

  • limit (optional) (Model or Flag)

    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.

  • modal (optional) (boolean)

    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 items selected or null if menu cancelled

    Return type

    Number

    Example

    To 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])

    Description

    Sets a flag on the database history.

    Arguments

  • flag (Flag)

    Flag to set on the database history

    Returns

    No return value

    Example

    To set flag f for database history c:

    c.SetFlag(f);


    Sketch(redraw (optional)[boolean])

    Description

    Sketches the database history. The database history will be sketched until you either call History.Unsketch(), History.UnsketchAll(), Model.UnsketchAll(), or delete the model

    Arguments

  • redraw (optional) (boolean)

    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().

    Returns

    No return value

    Example

    To sketch database history c:

    c.Sketch();


    SketchFlagged(Model[Model], flag[Flag], type (optional)[constant], redraw (optional)[boolean]) [static]

    Description

    Sketches all of the flagged database histories in the model.

    Arguments

  • Model (Model)

    Model that all the flagged database histories will be sketched in

  • flag (Flag)

    Flag set on the database histories that you want to sketch

  • type (optional) (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 or History.ALL_TYPES. If omitted, applied to all database history types.

  • redraw (optional) (boolean)

    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().

    Returns

    No return value

    Example

    To 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]

    Description

    Unblanks all of the database histories in the model.

    Arguments

  • Model (Model)

    Model that all database histories will be unblanked in

  • redraw (optional) (boolean)

    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().

  • type (optional) (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 or History.ALL_TYPES. If omitted, applied to all database history types.

    Returns

    No return value

    Example

    To unblank all of the database histories in model m:

    History.UnblankAll(m);


    UnblankFlagged(Model[Model], flag[Flag], type (optional)[constant], redraw (optional)[boolean]) [static]

    Description

    Unblanks all of the flagged database histories in the model.

    Arguments

  • Model (Model)

    Model that the flagged database histories will be unblanked in

  • flag (Flag)

    Flag set on the database histories that you want to unblank

  • type (optional) (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 or History.ALL_TYPES. If omitted, applied to all database history types.

  • redraw (optional) (boolean)

    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

    Example

    To 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]

    Description

    Unsets a defined flag on all of the database histories in the model.

    Arguments

  • Model (Model)

    Model that the defined flag for all database histories will be unset in

  • flag (Flag)

    Flag to unset on the database histories

  • type (optional) (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 or History.ALL_TYPES. If omitted, applied to all database history types.

    Returns

    No return value

    Example

    To unset the flag f on all the database histories in model m:

    History.UnflagAll(m, f);


    Unsketch(redraw (optional)[boolean])

    Description

    Unsketches the database history.

    Arguments

  • redraw (optional) (boolean)

    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().

    Returns

    No return value

    Example

    To unsketch database history c:

    c.Unsketch();


    UnsketchAll(Model[Model], redraw (optional)[boolean]) [static]

    Description

    Unsketches all database histories.

    Arguments

  • Model (Model)

    Model that all database histories will be unblanked in

  • redraw (optional) (boolean)

    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().

    Returns

    No return value

    Example

    To unsketch all database histories in model m:

    History.UnsketchAll(m);


    UnsketchFlagged(Model[Model], flag[Flag], type (optional)[constant], redraw (optional)[boolean]) [static]

    Description

    Unsketches all flagged database histories.

    Arguments

  • Model (Model)

    Model that all database histories will be unblanked in

  • flag (Flag)

    Flag set on the database histories that you want to sketch

  • type (optional) (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 or History.ALL_TYPES. If omitted, applied to all database history types.

  • redraw (optional) (boolean)

    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().

    Returns

    No return value

    Example

    To unsketch all of the database histories in model m flagged with f:

    History.UnsketchFlagged(m, f);


    Xrefs()

    Description

    Returns the cross references for this database history.

    Arguments

    No arguments

    Returns

    Xrefs object.

    Return type

    Xrefs

    Example

    To get the cross references for this database history:

    var xrefs = c.Xrefs();


    toString()

    Description

    Creates 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().

    Arguments

    No arguments

    Returns

    string

    Return type

    String

    Example

    To get data for database history c in keyword format

    var s = c.toString();