FormIt Plugin API  v23.0.0 (2023.0.0)
FormIt.Levels API

Description

Functions

json FormIt.Levels.AddLevels (nHistoryID, numLevels, startElevation, deltaElevation)
 
json FormIt.Levels.AutoRenameLevels (nHistoryID)
 Renames all levels with a default name according to the elevation order. More...
 
json FormIt.Levels.ChangeLevelElevation (nHistoryID, levelID, newElevation)
 Change the given level's elevation. More...
 
json FormIt.Levels.ChangeLevelName (levelID, levelName)
 Change the given level's name. More...
 
json FormIt.Levels.CreateDefaultLevels (nHistoryID)
 Create default levels in the given History. More...
 
json FormIt.Levels.DeleteLevels (nHistoryID, aLevelIDs)
 Delete the given levels in the given History. More...
 
json FormIt.Levels.GetDefaultLevelHeight ()
 Returns the default level height. More...
 
json FormIt.Levels.GetLevels (nHistoryID, sortByElevation)
 Returns a vector of all levels within a history. More...
 
json FormIt.Levels.GetLevelsVisible ()
 Returns if levels are visible. More...
 
json FormIt.Levels.GetNumLevels (nHistoryID)
 Returns the number of levels in the given history. More...
 
json FormIt.Levels.GetMinLevelElevation (nHistoryID)
 Returns the elevation of the lowest level in the given history. More...
 
json FormIt.Levels.GetMaxLevelElevation (nHistoryID)
 Returns the elevation of the highest level in the given history. More...
 
json FormIt.Levels.GetLevelData (nHistoryID, levelID)
 GetLevelData. More...
 
json FormIt.Levels.GetLevelsData (nHistoryID, sortByElevation)
 Returns a vector of LevelData for all levels within a history. More...
 
json FormIt.Levels.GetLevelIDsFromSelectedObjects (nHistoryID)
 Returns the union of levels of each object and the Result (Success). More...
 
json FormIt.Levels.HasLevelsInProject (checkVisibleOnly)
 Checks if there are any objects in the main history that have levels applied. More...
 
json FormIt.Levels.IsExistingLevel (nHistoryID, levelName)
 Returns true if the given Level name exists. More...
 
json FormIt.Levels.IsExistingLevelByElevation (nHistoryId, elevation)
 
json FormIt.Levels.IsValidLevelDeltaElevation (nHistoryID, deltaElevationString, numLevels)
 Checks if the string containing the delta elevation is valid. More...
 
json FormIt.Levels.IsValidLevelElevation (nHistoryID, levelId, elevationString)
 Checks if the string containing the elevation is valid for a level. More...
 
json FormIt.Levels.IsValidLevelName (levelID, levelName)
 Returns true is the given level name is valid. More...
 
json FormIt.Levels.IsValidNumberOfLevelsToAdd (nHistoryID, numLevelsString, deltaElevation)
 Checks if the string containing the number of levels is valid. More...
 
json FormIt.Levels.SetLevelsToSelectedObjects (nHistoryID, aLevelList)
 Set the given levels to be the levels for all currently selected objects. More...
 
json FormIt.Levels.SetLevelsVisible (aVisible)
 Sets levels visibility. More...
 
json FormIt.Levels.SetReportAreaByLevelsOnSelection (bON)
 SetReportAreaByLevelsOnSelection. More...
 
json FormIt.Levels.GetAreaForObjects (nHistoryID, aLevelId, aObjectIds)
 GetAreaForObjects. More...
 

Function Documentation

json FormIt.Levels.AddLevels ( nHistoryID  ,
numLevels  ,
startElevation  ,
deltaElevation   
)
json FormIt.Levels.AutoRenameLevels ( nHistoryID  )

Renames all levels with a default name according to the elevation order.

Parameters
[in]historyIDint
[in]nHistoryIDint
Returns
JSON_UNDEFINED
json FormIt.Levels.ChangeLevelElevation ( nHistoryID  ,
levelID  ,
newElevation   
)

Change the given level's elevation.

Parameters
[in]historyIDint
[in]levelIDint
[in]newElevationdouble
[in]nHistoryIDint
Returns
bool Success
json FormIt.Levels.ChangeLevelName ( levelID  ,
levelName   
)

Change the given level's name.

Parameters
[in]levelIDint
[in]levelNameString
Returns
bool Success
json FormIt.Levels.CreateDefaultLevels ( nHistoryID  )

Create default levels in the given History.

Parameters
[in]historyIDint
[in]nHistoryIDint
Returns
bool Success
json FormIt.Levels.DeleteLevels ( nHistoryID  ,
aLevelIDs   
)

Delete the given levels in the given History.

Parameters
[in]historyIDint
[in]aLevelIDsArray of int
[in]nHistoryIDint
Returns
bool Success
json FormIt.Levels.GetAreaForObjects ( nHistoryID  ,
aLevelId  ,
aObjectIds   
)

GetAreaForObjects.

Parameters
[in]nHistoryID
[in]aLevelId
[in]aObjectIds
Returns
double area of level on given objects
json FormIt.Levels.GetDefaultLevelHeight ( )

Returns the default level height.

Returns
double Default Level Height
json FormIt.Levels.GetLevelData ( nHistoryID  ,
levelID   
)

GetLevelData.

Parameters
[in]historyIDint
[in]levelIDint
[in]nHistoryIDint
Returns
{ "Result:" result, "LevelData", data}
json FormIt.Levels.GetLevelIDsFromSelectedObjects ( nHistoryID  )

Returns the union of levels of each object and the Result (Success).

Parameters
[in]historyIDint
[in]nHistoryIDint
Returns
{ "Result:" result, "LevelsData", data}
json FormIt.Levels.GetLevels ( nHistoryID  ,
sortByElevation   
)

Returns a vector of all levels within a history.

Parameters
[in]historyIDint
[in]sortByElevationbool - set to true to sort the levels by elevation in ascending order
[in]nHistoryIDint
Returns
Array of Level IDs
json FormIt.Levels.GetLevelsData ( nHistoryID  ,
sortByElevation   
)

Returns a vector of LevelData for all levels within a history.

Parameters
[in]historyIDint
[in]sortByElevationbool - set to true to sort the levels by elevation in ascending order
[in]nHistoryIDint
Returns
Array of LevelData
json FormIt.Levels.GetLevelsVisible ( )

Returns if levels are visible.

Returns
Returns true if levels are visible
json FormIt.Levels.GetMaxLevelElevation ( nHistoryID  )

Returns the elevation of the highest level in the given history.

Parameters
[in]historyIDint
[in]nHistoryIDint
Returns
The elevation of the highest level in the given history.
json FormIt.Levels.GetMinLevelElevation ( nHistoryID  )

Returns the elevation of the lowest level in the given history.

Parameters
[in]historyIDint
[in]nHistoryIDint
Returns
The elevation of the lowest level in the given history.
json FormIt.Levels.GetNumLevels ( nHistoryID  )

Returns the number of levels in the given history.

Parameters
[in]historyIDint
[in]nHistoryIDint
Returns
The number of levels in the given history
json FormIt.Levels.HasLevelsInProject ( checkVisibleOnly  )

Checks if there are any objects in the main history that have levels applied.

If checkVisibleOnly is true, only visible objects are checked. Returns true, if there is at least one object with at least one level

Parameters
[in]checkVisibleOnlybool
Returns
Returns true, if there is at least one object with at least one level
json FormIt.Levels.IsExistingLevel ( nHistoryID  ,
levelName   
)

Returns true if the given Level name exists.

Parameters
[in]nHistoryIDint
[in]levelNameString
Returns
True if the Level exists
json FormIt.Levels.IsExistingLevelByElevation ( nHistoryId  ,
elevation   
)
json FormIt.Levels.IsValidLevelDeltaElevation ( nHistoryID  ,
deltaElevationString  ,
numLevels   
)

Checks if the string containing the delta elevation is valid.

"numLevels" indicates the number of levels intended to be added. Returns Result (Success) and the elevation. Also returns an error string that can be posted in the UI if the string to value conversion fails.

Parameters
[in]nHistoryIDint
[in]deltaElevationStringString
[in]numLevelsint
Returns
{ "Result:" result, "Elevation", elevation, "Error:", error }
json FormIt.Levels.IsValidLevelElevation ( nHistoryID  ,
levelId  ,
elevationString   
)

Checks if the string containing the elevation is valid for a level.

Returns success and the elevation. Also returns an error string that can be posted in the UI, if the string to value conversion fails.

Parameters
[in]nHistoryIDint
[in]levelIdint
[in]elevationStringString
Returns
{ "Result:" result, "Elevation", elevation, "Error:", error }
json FormIt.Levels.IsValidLevelName ( levelID  ,
levelName   
)

Returns true is the given level name is valid.

Parameters
[in]levelIDint
[in]levelNameString
Returns
{ { "Result", vaild },{ "Error", errorMsg } };
json FormIt.Levels.IsValidNumberOfLevelsToAdd ( nHistoryID  ,
numLevelsString  ,
deltaElevation   
)

Checks if the string containing the number of levels is valid.

"deltaElevation" indicates the spacing between the levels intended to be added. Returns success and the number of levels. Also returns an error string that can be posted in the UI, if the string to value conversion fails.

Parameters
[in]nHistoryIDint
[in]numLevelsStringString
[in]deltaElevationdouble
Returns
{ "Result:" result, "Elevation", elevation, "Error:", error }
json FormIt.Levels.SetLevelsToSelectedObjects ( nHistoryID  ,
aLevelList   
)

Set the given levels to be the levels for all currently selected objects.

Parameters
[in]nHistoryIDint
[in]aLevelListArray of int
Returns
bool Success
json FormIt.Levels.SetLevelsVisible ( aVisible  )

Sets levels visibility.

Parameters
[in]aVisiblebool
Returns
JSON_UNDEFINED
json FormIt.Levels.SetReportAreaByLevelsOnSelection ( bON  )

SetReportAreaByLevelsOnSelection.

Parameters
[in]bONbool
Returns
JSON_UNDEFINED