The Group class gives you access to groups in T/HIS. More...
The T/HIS 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:
Detailed DescriptionThe Group class allows you to create, and modify groups. See the documentation below for more details. |
Constructornew Group(name[string])DescriptionCreate a new Group object. |
Group name used to reference the group
ReturnsGroup object Return typeGroup |
ExampleTo create a new group with the name X-Velocity var l = new Group("X-velocity");
|
Details of functionsAdd(Curve[Curve])DescriptionAdds a curve object to group. |
Curve that will be added to group
ReturnsNo return value. |
ExampleTo add curve c to curve group g: g.Add(c);
|
AddAll()DescriptionAdds all curves to group. |
No arguments
ReturnsNo return value. |
ExampleTo add all curves to curve group g: g.AddAll();
|
AddID(ID[integer])DescriptionAdds curve by ID to a group. |
The ID of the curve you want to add.
ReturnsNo return value. |
ExampleTo add curve 3 to curve group g: g.AddID(3);
|
Contains(Curve[Curve])DescriptionChecks if a curve object is in a curve group. |
Curve that will be checked
ReturnsTRUE if the curve is in the group, otherwise FALSE Return typeBoolean |
ExampleTo check if a curve object n is in group g var exists = g.Contains(n);
|
ContainsID(ID[integer])DescriptionChecks if a curve ID is in a curve group. |
The ID of the curve you want to check.
ReturnsTRUE if the curve is in the group, otherwise FALSE Return typeBoolean |
ExampleTo check if a curve ID n is in group g var exists = g.ContainsID(n);
|
DeleteGroup(group ID or name[integer or string], delete automatic groups (optional)[integer]) [static]DescriptionDeletes a curve group |
ID of group to delete or name of group. If this argument is 0, delete all groups. Automatically generated groups won't be deleted unless the next argument is set to 1.
If this argument is 1, automatic groups can be deleted. If no argument or 0, automatic groups cant be deleted.
ReturnsNo return value |
ExampleTo delete group n Group.DeleteGroup(n);
|
Get(Name[string]) [static]DescriptionReturns a group object. |
Name of the group to return object for
ReturnsGroup object (or Null if the group does not exist). Return typeGroup |
ExampleTo get the group called 'left' var group = Group.Get("left");
|
GetCurveIDs()DescriptionReturns an array of Curve ID's for all the Curves in the group. |
No arguments
ReturnsArray of integers. Return typeNumber |
ExampleTo make an array of Curve ID's for all the curves in group g: var curves = g.GetCurveIDs();
|
GetCurves()DescriptionReturns an array of Curve Objects for all the Curves in the group. |
No arguments
ReturnsArray of Curve objects. Return typeArray |
ExampleTo make an array of Curve objects for all the curves in group g: var curves = g.GetCurves();
|
GetFromID(ID[integer]) [static]DescriptionReturns a group object. |
ID of the group to return object for
ReturnsGroup object (or Null if the group does not exist). Return typeGroup |
ExampleTo get the group number 1 var group = Group.GetFromID(1);
|
Remove(Curve[Curve])DescriptionRemoves a curve object from a group. |
Curve that will be removed from group
ReturnsNo return value. |
ExampleTo remove curve c from curve group g: g.Remove(c);
|
RemoveAll()DescriptionRemoves all curves from a group. |
No arguments
ReturnsNo return value. |
ExampleTo remove all curves from curve group g: g.RemoveAll();
|
RemoveID(ID[integer])DescriptionRemove a curve by ID from a group. |
The ID of the curve you want to remove.
ReturnsNo return value. |
ExampleTo remove curve 3 from curve group g: g.RemoveID(3);
|
Spool()DescriptionSpools a group, entry by entry and returns the curve objects. See also Group.StartSpool |
No arguments
ReturnsCurve Object of item, or NULL if no more curves in group Return typeCurve |
ExampleTo spool group g: var id;
g.StartSpool();
while (id = g.Spool() )
{
do something...
}
|
SpoolID()DescriptionSpools a group, entry by entry and returns the curve ID's or 0 when no more curves in group. See also Group.StartSpool |
No arguments
Returnsinteger Return typeNumber |
ExampleTo spool group g : var id;
g.StartSpool();
while (id = g.SpoolID() )
{
do something...
}
|
StartSpool()DescriptionStarts a group spooling operation. See also Group.Spool |
No arguments
ReturnsNo return value |
ExampleTo start spooling group g: g.StartSpool();
|
Total() [static]DescriptionReturns the total number of curve group currently defined |
No arguments
ReturnsNumber of curve groups currently defined. Return typeNumber |
ExampleTo get the number of curve groups var total = Group.Total();
|