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

Description

Functions

json FormIt.Layers.GetAllLayers ()
 
json FormIt.Layers.GetLayerData (layerID)
 GetLayerData gets the data for a single layer. More...
 
json FormIt.Layers.GetAllLayerData ()
 GetAllLayerData gets the data for all layers. More...
 
json FormIt.Layers.AddLayer (historyID, layerName, visible)
 AddLayer creates a new layer in the given history. More...
 
json FormIt.Layers.IsValid (layerID)
 IsValid returns whether a layer id is valid. More...
 
json FormIt.Layers.SetLayersVisibility (aLayersVisibility)
 SetLayersVisibility sets the visibility of a vector of layers. More...
 
json FormIt.Layers.SetLayerVisibility (layerName, visibility)
 SetLayerVisibility sets the visibility of layer with a given name and visibility toggle. More...
 
json FormIt.Layers.LayerExists (layerName)
 LayerExists returns true if a layer with the given name exists. More...
 
json FormIt.Layers.DeleteLayers (aLayerIDs)
 DeleteLayers deletes a list of layers. More...
 
json FormIt.Layers.IsValidLayerName (layerID, newLayerName)
 IsValidLayerName checks whether the name is valid for a layer. More...
 
json FormIt.Layers.SetLayerName (layerID, newLayerName)
 SetLayerName set a new name for the given layer. More...
 
json FormIt.Layers.AssignLayerToObjects (layerID, aObjects)
 AssignLayerToObjects assigns a layer to a list of objects. More...
 
json FormIt.Layers.RemoveLayersFromObjects (layerIDs, aObjects)
 RemoveLayersFromObjects removes all the layers in a vector from a vector of objects, regardless of whether any of the objects actually are assigned any of the layers. More...
 
json FormIt.Layers.GetAllObjectsOnLayers (layerIDs, allHistories)
 GetAllObjectsOnLayers gets all objects that are on the given layers. More...
 
json FormIt.Layers.ChangeLayerOrder (layerID, newPosition)
 ChangeLayerOrder gives a layer a new position in the list. More...
 
json FormIt.Layers.GetObjectLayerID (nHistoryID, nObjectID)
 GetObjectLayerID returns the layer id for the object. More...
 
json FormIt.Layers.IsValidObjectForLayerAssignment (nHistoryID, nObjectID)
 IsValidObjectForLayerAssignment returns whether the given object can be assigned a layer object must be top level (non owned) or a group instance. More...
 
json FormIt.Layers.GetLayerList ()
 GetLayerList gets a list of all layers as LayerData. More...
 
json FormIt.Layers.GetObjectsLayerList (groupInstacePathArray, bIncludeNoLayer)
 GetObjectsLayerList returns the set of layers the given Objects are on. More...
 
json FormIt.Layers.GetLayerID (layerName)
 GetLayerID returns the formit layer id from a layer name or WSM.INVALID_ID if a layer with that name does not exist. More...
 
json FormIt.Layers.SetLayerPickable (layerID, pickable)
 Set the pickable status of a layer. More...
 
json FormIt.Layers.SetLoadInRevit (layerID, load)
 Set the load in Revit status of a layer. More...
 
json FormIt.Layers.IsSectionPlaneOrIndicatorLayer (layerID)
 Check whether the layer is either a section indicator or section plane layer. More...
 
json FormIt.Layers.CountObjectsOnLayer (aObjects, layerID)
 Returns how many of the objects in objectPaths, or their owners are on the given layer If layerId is passed as WSM.INVALID_ID, it counts how many objects are not on any layer. More...
 

Function Documentation

json FormIt.Layers.AddLayer ( historyID  ,
layerName  ,
visible   
)

AddLayer creates a new layer in the given history.

Parameters
[in]historyIDint
[in]layerNameString
[in]visiblebool
Returns
bool Success
json FormIt.Layers.AssignLayerToObjects ( layerID  ,
aObjects   
)

AssignLayerToObjects assigns a layer to a list of objects.

Parameters
[in]layerIDint
[in]aObjectsArray of objects (WSM.GroupInstancePath)
Returns
Success
json FormIt.Layers.ChangeLayerOrder ( layerID  ,
newPosition   
)

ChangeLayerOrder gives a layer a new position in the list.

Parameters
[in]layerIDint
[in]newPositionint
Returns
Success
json FormIt.Layers.CountObjectsOnLayer ( aObjects  ,
layerID   
)

Returns how many of the objects in objectPaths, or their owners are on the given layer If layerId is passed as WSM.INVALID_ID, it counts how many objects are not on any layer.

Parameters
[in]aObjectsArray of WSM.GroupInstancePath
[in]layerIDint Id of the layer
Returns
{...}
json FormIt.Layers.DeleteLayers ( aLayerIDs  )

DeleteLayers deletes a list of layers.

Parameters
[in]aLayerIDsArray of layer ids
Returns
JSON_UNDEFINED
json FormIt.Layers.GetAllLayerData ( )

GetAllLayerData gets the data for all layers.

Returns
Returns layer data array. Returns array of LayerData
json FormIt.Layers.GetAllLayers ( )
json FormIt.Layers.GetAllObjectsOnLayers ( layerIDs  ,
allHistories   
)

GetAllObjectsOnLayers gets all objects that are on the given layers.

Parameters
[in]layerIDsArray of layer ids
[in]allHistories(optional) Include all Historys
Returns
Array of objects (WSM.GroupInstancePath)
json FormIt.Layers.GetLayerData ( layerID  )

GetLayerData gets the data for a single layer.

Parameters
[in]layerID
Returns
Returns layer data : id, name, visibility. Returns false if layerID does not exist.
json FormIt.Layers.GetLayerID ( layerName  )

GetLayerID returns the formit layer id from a layer name or WSM.INVALID_ID if a layer with that name does not exist.

Parameters
[in]layerNameString
Returns
Layer id or WSM.INVALID_ID
json FormIt.Layers.GetLayerList ( )

GetLayerList gets a list of all layers as LayerData.

Returns
Returns array of layer data : id, name, visibility
json FormIt.Layers.GetObjectLayerID ( nHistoryID  ,
nObjectID   
)

GetObjectLayerID returns the layer id for the object.

Returns WSM.INVALID_ID if the object does not have a layer.

Parameters
[in]nHistoryIDint
[in]nObjectIDint
Returns
Layer id or WSM.INVALID_ID
json FormIt.Layers.GetObjectsLayerList ( groupInstacePathArray  ,
bIncludeNoLayer   
)

GetObjectsLayerList returns the set of layers the given Objects are on.

If bIncludeNoLayer is true, an uninitialized LayerData will be added to the set.

Parameters
[in]bIncludeNoLayerbool (optional)
[in]groupInstacePathArrayWSM.GroupInstancePathArray
Returns
Returns array of layer data : id, name, visibility
json FormIt.Layers.IsSectionPlaneOrIndicatorLayer ( layerID  )

Check whether the layer is either a section indicator or section plane layer.

Parameters
[in]layerIDint Id of the layer
Returns
JSON_UNDEFINED
json FormIt.Layers.IsValid ( layerID  )

IsValid returns whether a layer id is valid.

Parameters
[in]layerIDint
Returns
bool Valid
json FormIt.Layers.IsValidLayerName ( layerID  ,
newLayerName   
)

IsValidLayerName checks whether the name is valid for a layer.

Returns success. Also returns an error string that can be posted in the UI, if the name is not valid.

Parameters
[in]layerIDint
[in]newLayerNameString
Returns
{ Result (bool), Error (I18nString) }
json FormIt.Layers.IsValidObjectForLayerAssignment ( nHistoryID  ,
nObjectID   
)

IsValidObjectForLayerAssignment returns whether the given object can be assigned a layer object must be top level (non owned) or a group instance.

Parameters
[in]nHistoryIDint
[in]nObjectIDint
Returns
bool Valid
json FormIt.Layers.LayerExists ( layerName  )

LayerExists returns true if a layer with the given name exists.

Parameters
[in]layerNameString
Returns
bool Exists
json FormIt.Layers.RemoveLayersFromObjects ( layerIDs  ,
aObjects   
)

RemoveLayersFromObjects removes all the layers in a vector from a vector of objects, regardless of whether any of the objects actually are assigned any of the layers.

Parameters
[in]layerIDsArray of layer ids
[in]aObjectsArray of WSM.GroupInstancePath
Returns
JSON_UNDEFINED
json FormIt.Layers.SetLayerName ( layerID  ,
newLayerName   
)

SetLayerName set a new name for the given layer.

Parameters
[in]layerIDint
[in]newLayerNameString
Returns
Success
json FormIt.Layers.SetLayerPickable ( layerID  ,
pickable   
)

Set the pickable status of a layer.

Parameters
[in]layerIDint Id of the layer
[in]pickablebool true to set the layer pickable, false to lock it
Returns
JSON_UNDEFINED
json FormIt.Layers.SetLayersVisibility ( aLayersVisibility  )

SetLayersVisibility sets the visibility of a vector of layers.

Parameters
[in]aLayersVisibilityArray of layer data (see GetLayerData)
Returns
JSON_UNDEFINED
json FormIt.Layers.SetLayerVisibility ( layerName  ,
visibility   
)

SetLayerVisibility sets the visibility of layer with a given name and visibility toggle.

Parameters
[in]layerNameis string containing the layer name
[in]visibilityis a boolean specifying whether to turn layer on or off
Returns
boolean if the api is successful
json FormIt.Layers.SetLoadInRevit ( layerID  ,
load   
)

Set the load in Revit status of a layer.

Parameters
[in]layerIDint Id of the layer
[in]loadbool true to set the layer to load in Revit
Returns
JSON_UNDEFINED