Lava Scripting Support

Gantt module functions by category

Error functions

HasError()
GetGanttLastError()

Project Setup functions

Activity Type

Split()

Description : Parse out attributes from a triangulation's name based on the delimiter.

Return value: User defined character.

@results = Gantt::SPLIT(attribute, delimeter, bin)

In the example of an attribute called Activity Name and an example name being 3-SE105-EXT-1

Zone: SPLIT( [ATT:Activity Name], '-', 1) that would return 3
Area: SPLIT( [ATT:Activity Name], '-', 2) that would return SE105
Type: SPLIT( [ATT:Activity Name], '-', 3) that would return EXT
Room: SPLIT( [ATT:Activity Name], '-', 4) that would return 1

Attributes

Calendar

File

Save(projectName)

Filter Definition

GetFilterNames()
ApplyFilter(filterName)
ClearFilter()
AddFilter(filterName,filterExpression)
RemoveFilter(filterName)

Lookup Table Definition

GetLookupTableNames()
AddLookupTable(tableName, tableValues)
GetLookupTableValues(tableName)
SetLookupTableValues(tableName, tableValues)
RemoveLookupTable(tableName)

Period Definition

GetPeriodNames()
ApplyPeriod(periodName)
ClearPeriod()
RemovePeriod(periodName)

Precedence Group Definition

GetPrecedenceGroupNames()
ApplyPrecedenceGroup(groupName)
ClearPrecedenceGroup()
AddPrecedenceGroup(groupName, lineStyle, colour, isApplied)

Report Definition

GetReportNames()
ApplyReport(reportName)
ClearReport()
RemoveReport(reportName)

Resource Definition

GetResourceNames()
RemoveResource(resourceName)

Activities Functions

Attribute

GetSingleAttributeValue(attrName)
GetAttributeValues(attrNameListReference)
SetAttributeValue(attrName, attrValue)

Create an Activity

CreateActivity(id)

Edit

RemoveAllActivities()
RemoveActivity(id)
RemoveActivities(idListReference)

Flow

Information

GetActivitiesCount(total)

Precedence

GetPredecessorList(actId)
GetSuccessorList(actId)
AddPrecedence(actStart, actEnd, type, lag)
actStart
actEnd
type
lag
RemovePrecedence()

Selection

SelectActivity(id)
SelectActivities(idListReference)
bool ClearLevelingDelays(const bool& keepStartEnd)
bool ClearLevelingDelaysSelection(const bool& keepStartEnd, const int_&list ids)
bool SetPauseUserInterface(const bool& pause)
bool SplitActivity(const int& id, const int& taskBarIndex, const double& proportion, const double& delay)
bool SplitCurrentActivity(const int& taskBarIndex, const double& proportion, const double& delay)
bool SplitActivities(const int_list& ids, const double& proportion, const double& delay)

Methods to add or modify resources

AddResource(name, calendarName)

Will add a resource.

name - name of resource

calendarName - name of calendar

AddResourceWithRateCapacity(name, calendarName, rate, capacity)

Will add a resource with rate and capacity.

name - name of resource

calendarName - name of calendar

rate - rate of the activity

capacity - capacity of resource

ResourceSetDefaultRate(resourceName, rate)

See note below

Will set the default rate of an activity.

resourceName - name of resource

rate - rate of the activity

ResourceSetDefaultRateAndMethod(resourceName, rate)

See note below

Will set the default rate and method of a resource.

resourceName - name of resource

rate - rate of the activity

ResourceSetDefaultCapacity(resourceName, capacity)

See note below

Will set the default capacity of a resource.

resourceName - name of resource

capacity - capacity of the resource

ResourceSetDefaultCapacityAndMethod(resourceName, capacity)

See note below

Will set the default capacity and method of a resource.

resourceName - name of resource

capacity - capacity of the resource

Note

In VGS, a Resource has a rate and a capacity. However, the rate and capacity can be defined in more than one way. For both rate and capacity there is a default value which is the simple case in which it is the only value used. The first method (ResourceSetDefault) will set this value but not change the Rate Method or Capacity Method. The second method (ResourceSetDefaultAndMethod) will set the value and change the Rate Method or Capacity Method to use the new value.

Rate Method

There are 3 ways the rate can be defined in a Resource,

Default - Single value for any activity using the resource

Expression Rate - An expression defines the rate. This can use VGS Attributes and/or Attributes from Vulcan.

Use Variable Rate - The rate is defined by Activity Type

Capacity Method

There are 2 ways the capacity can be defined in a Resource.

Default - Single value for any activity using the resource

Variable Capacity - The capacity is, effectively, defined for a date range.

ResourceSetRateExpression(resourceName, rateExpression)

Will set the rate expression for the resource.

resourceName - name of resource

rateExpression - expression specifying the formula calculating the rate of the resource

ResourceAddVariableRateItemActivityTypeRate(resourceName, activityTypeName)

Will set the variable rate for the selected activity type using the default rate defined in the activity type.

resourceName - name of resource

activityTypeName - name of the activity type

ResourceAddVariableRateItem(resourceName, activityTypeName, rate)

Will add a variable for the rate of the selected activity type and assign the rate.

resourceName - name of resource

activityTypeName - name of the activity type

rate - rate of the activity

ResourceRemoveVariableRateItem(resourceName, activityTypeName)

Will remove a variable for the rate of selected activity type.

resourceName - name of resource

activityTypeName - name of the activity type

ResourceAddVariableCapacityItem(resourceName, startDate, capacity)

Will add a variable to store the capacity of the resource, and assign the start date and capacity.

resourceName - name of resource

startDate - start date

capacity - capacity of the resource

ResourceRemoveVariableCapacityItem(resourceName, startDate)

Will remove the variable used to store the capacity of the resource.

resourceName - name of resource

startDate - start date

ResourceSetCalendar(name, calendarName)

Will set the calendar.

name - name of resource

calendarName - name of calendar

GetDateFormat()

Returns the date format.

Methods to modify resource allocations

AddResourceToActivity(resourceName, activityTypeName, activityName)

Will add a resource to an activity.

resourceName - name of resource

activityTypeName - name of the activity type

activityName - name of activity

Note:  Will work with an empty activityTypeName value if the activityName is unique within the project.

AddResourceToActivityById(resourceName, id)

Will add a resource to an activity using the ID.

resourceName - name of resource

id - ID of activity

RemoveResourceFromActivity(resourceName, activityTypeName, activityName)

Will remove a resource from an activity.

resourceName - name of resource

activityTypeName - name of the activity type

activityName - name of activity

Note:  Will work with an empty activityTypeName value if the activityName is unique within the project.

RemoveResourceFromActivityById(resourceName, id)

Will remove a resource from an activity using the ID.

resourceName - name of resource

id - ID of activity

AddResourceToActivities(resourceName)

Will add a resource to an activity.

resourceName - name of resource

Note:  Will add the resource to all displayed activities.

RemoveResourceFromActivities(resourceName)

Will remove a resource from an activity.

resourceName - name of resource

Note:  Will remove the resource from all displayed activities.

Related topics

Introduction

Running a Lava Script

Functions

Classes

Example

GPAN