BaseEntity

BaseEntity

Class to represent an entity for extracting data

This is intended to be a base class for other classes to extend, so shouldn't be used directly.

To extend it the static EntityTags() method needs to be implemented in the child class as well as the entity tag constants.

Constructor

new BaseEntity(entity_type, id, name, tag, measurements, history_titleopt, isoopt)

Source:
Parameters:
Name Type Attributes Default Description
entity_type string Entity type constant
id string | number Entity id (label or database history name)
name string Entity name
tag string Entity tag
measurements Array.<Measurement> List of raw measurements that can be read from the entity
history_title string <optional>
"" The entity database history title
iso string <optional>
"" The entity iso name

Members

(static) BEAM_BASIC :string

Description:
  • Beam entity type
Source:
Beam entity type
Type:
  • string

(static) JOINT :string

Description:
  • Joint entity type
Source:
Joint entity type
Type:
  • string

(static) NODE :string

Description:
  • Node entity type
Source:
Node entity type
Type:
  • string

(static) PART :string

Description:
  • Part entity type
Source:
Part entity type
Type:
  • string

(static) SPRING_ROTATIONAL :string

Description:
  • Rotational spring entity type
Source:
Rotational spring entity type
Type:
  • string

(static) SPRING_TRANSLATIONAL :string

Description:
  • Translational spring entity type
Source:
Translational spring entity type
Type:
  • string

(static) XSECTION :string

Description:
  • X-Section entity type
Source:
X-Section entity type
Type:
  • string

entity_type :string

Description:
  • Entity type constant
Source:
Entity type constant
Type:
  • string

history_title :string

Description:
  • The history_title text for the label
Source:
The history_title text for the label
Type:
  • string

id :string|number

Description:
  • Entity id (label or database history name)
Source:
Entity id (label or database history name)
Type:
  • string | number

iso :string

Description:
  • The iso text for the label
Source:
The iso text for the label
Type:
  • string

measurements :Array.<Measurement>

Description:
  • Measurements
Source:
Measurements
Type:

name :string

Description:
  • Entity name
Source:
Entity name
Type:
  • string

tag :string

Description:
  • Entity tag
Source:
Entity tag
Type:
  • string

Methods

(static) EntityTags() → {Array.<string>}

Description:
  • Returns an array of all the available entity tag strings This needs to be overridden by child classes
Source:
Returns:
Type
Array.<string>

(static) EntityTypes() → {Array.<string>}

Description:
  • Return an array of all the available entity type strings
Source:
Example
let entity_types = BaseEntity.EntityTypes();
Returns:
Type
Array.<string>

(static) GetHistoryTitleForId(entity_type, id) → {string}

Description:
  • this function returns the history title of the entity from the current model (gui.model) if the title exists
Source:
Parameters:
Name Type Description
entity_type string
id string | number integer id of entity
Returns:
if blank then it means no history title set or id was not int
Type
string

(static) Pick(entity_type, model) → {string|number}

Description:
  • Interactively pick an entity by type
Source:
Example
let entity_id = BaseEntity.Pick(BaseEntity.NODE);
Parameters:
Name Type Description
entity_type string Entity type constant
model Model Restrict picking to this model
Returns:
Type
string | number

(static) Select(entity_type, model, allow_multipleopt) → {number|Array.<number>}

Description:
  • Interactively select an entity by type
Source:
Example
let entity_id = BaseEntity.Select(BaseEntity.NODE);
Parameters:
Name Type Attributes Default Description
entity_type string Entity type constant
model Model Restrict selection to this model
allow_multiple boolean <optional>
false Allow multiple selection
Returns:
Type
number | Array.<number>

toJSON() → {object}

Description:
  • JSON representation
Source:
Example
let json = entity.toJSON();
Returns:
Type
object