FormIt Plugin API  v23.0.0 (2023.0.0)
FormIt API

Description

Modules

 FormIt.Analysis API
 
 FormIt.AutoSave API
 
 FormIt.Cameras API
 
 FormIt.Clipboard API
 
 FormIt.Collaboration API
 
 FormIt.Configuration API
 
 FormIt.Dynamo API
 
 FormIt.Files API
 
 FormIt.FileSystem API
 
 FormIt.Forge API
 
 FormIt.GroupEdit API
 
 FormIt.HUDManager API
 
 FormIt.ImageManager API
 
 FormIt.Layers API
 
 FormIt.Levels API
 
 FormIt.MaterialProvider API
 
 FormIt.Messaging API
 
 FormIt.Model API
 
 FormIt.Scenes API
 
 FormIt.Materials API
 
 FormIt.UndoManagement API
 
 FormIt.SectionPlanes API
 
 FormIt.Selection API
 
 FormIt.Commands API
 
 FormIt.Shortcuts API
 
 FormIt.SketchMaterials API
 
 FormIt.Statistics API
 
 FormIt.StringConversion API
 
 FormIt.SunAndLocation API
 
 FormIt.Tools API
 
 FormIt.UI API
 
 FormIt.Utils API
 
 FormIt.View API
 
 FormIt.VisualStyles API
 

Namespaces

 FormIt.Analysis
 FormIt.Analysis namespace.
 
 FormIt.AutoSave
 FormIt.AutoSave namespace.
 
 FormIt.Cameras
 FormIt.Cameras namespace.
 
 FormIt.Clipboard
 FormIt.Clipboard namespace.
 
 FormIt.Collaboration
 FormIt.Collaboration namespace.
 
 FormIt.Configuration
 FormIt.Configuration namespace.
 
 FormIt.Dynamo
 FormIt.Dynamo namespace.
 
 FormIt.Files
 FormIt.Files namespace.
 
 FormIt.FileSystem
 FormIt.FileSystem namespace.
 
 FormIt.Forge
 FormIt.Forge namespace.
 
 FormIt.GroupEdit
 FormIt.GroupEdit namespace.
 
 FormIt.HUDManager
 FormIt.HUDManager namespace.
 
 FormIt.ImageManager
 FormIt.ImageManager namespace.
 
 FormIt.Layers
 FormIt.Layers namespace.
 
 FormIt.Levels
 FormIt.Levels namespace.
 
 FormIt.MaterialProvider
 FormIt.MaterialProvider namespace.
 
 FormIt.Messaging
 FormIt.Messaging namespace.
 
 FormIt.Model
 FormIt.Model namespace.
 
 FormIt.Scenes
 FormIt.Scenes namespace.
 
 FormIt.Materials
 FormIt.Materials namespace.
 
 FormIt.UndoManagement
 FormIt.UndoManagement namespace.
 
 FormIt.SectionPlanes
 FormIt.SectionPlanes namespace.
 
 FormIt.Selection
 FormIt.Selection namespace.
 
 FormIt.Commands
 FormIt.Commands namespace.
 
 FormIt.Shortcuts
 FormIt.Shortcuts namespace.
 
 FormIt.SketchMaterials
 FormIt.SketchMaterials namespace.
 
 FormIt.Statistics
 FormIt.Statistics namespace.
 
 FormIt.StringConversion
 FormIt.StringConversion namespace.
 
 FormIt.SunAndLocation
 FormIt.SunAndLocation namespace.
 
 FormIt.Tools
 FormIt.Tools namespace.
 
 FormIt.UI
 FormIt.UI namespace.
 
 FormIt.Utils
 FormIt.Utils namespace.
 
 FormIt.View
 FormIt.View namespace.
 
 FormIt.VisualStyles
 FormIt.VisualStyles namespace.
 

Functions

json FormIt.GetSnap ()
 Get snapping state. More...
 
json FormIt.SetSnap (bSnap)
 Set snapping state. More...
 
json FormIt.GetTouchEnabled ()
 Are touch interactions enabled? More...
 
json FormIt.SetTouchEnabled (bTouchEnabled)
 Enable touch interactions. More...
 
json FormIt.ImportFile (sFileName, bGroupImport, nHistoryID, bKeepLevelsWhenGrouping)
 Imports the content of the given file. More...
 
json FormIt.OpenFile (sFileName)
 Open the given file. More...
 
json FormIt.LoadPreviewImage (sFileName)
 Load preview image of the given file. More...
 
json FormIt.SaveFile (sFileName, saveOptions, previewImage, forSave)
 Save the current model to the given file name. More...
 
json FormIt.SaveFileForEnergyAnalysis (sFileName)
 Save the current model to the given file name for energy analysis. More...
 
json FormIt.SetGeoLocationData (geodata)
 SetGeoLocationData() function. More...
 
json FormIt.SetRenderData (renderdata)
 SetRenderData() function. More...
 
json FormIt.GetTimeNow ()
 Get the time. More...
 
json FormIt.NewFile (forced)
 Run the new file method. More...
 
json FormIt.Version ()
 Get the version of FormIt. More...
 
json FormIt.SetCurveAccuracyOrCountDefault (accuracyORcount)
 Set the curve accuracy for the application. More...
 
json FormIt.GetCurveAccuracyOrCountDefault ()
 Get the curve accuracy for the application. More...
 
json FormIt.SetSurfaceAccuracyOrCountDefault (accuracyORcount)
 Set the surface accuracy for the application. More...
 
json FormIt.GetSurfaceAccuracyOrCountDefault ()
 Get the surface accuracy for the application. More...
 
json FormIt.GetAccuracyForQuarterCircle (accuracy)
 Get the accuracy for a quarter circle to be used to call SetCurveAccuracyOrCountDefault/SetSurfaceAccuracyOrCountDefault. More...
 
json FormIt.GetUnitTypeDefault ()
 Get the Application (as opposed to Model) UnitType. More...
 
json FormIt.SetUnitTypeDefault (unitType)
 Set the Application (as opposed to Model) UnitType. More...
 
json FormIt.IsWSRAvailable ()
 IsWSRAvailable() function. More...
 
json FormIt.SuspendMessaging (bSuppress, nTopLevelHistory, bFullUpdate)
 SuspendMessaging suspends all update messages from WSM until ResumeMessaging is called. More...
 
json FormIt.ResumeMessaging ()
 Resumes messaging that was suspended by a call to SuspendMessaging. More...
 
json FormIt.ChangeTargetBuildableArea (value)
 ChangeTargetBuildableArea() function. More...
 
json FormIt.GetBuildingType ()
 GetBuildingType() function. More...
 
json FormIt.SetBuildingType (value)
 SetBuildingType() function. More...
 
json FormIt.WriteAppDefaultContentToFile (id, path)
 WriteAppDefaultContentToFile() function. More...
 
json FormIt.DeleteImage (nHistoryID, imageID)
 DeleteImage() function. More...
 
json FormIt.HandleHUDTextInput (dimensionID, inputText)
 HandleHUDTextInput will handle the HUD input values Parameters: In: dimensionID Out: Boolean. More...
 
json FormIt.GetAppDefaultContentsWithoutAXM ()
 GetAppDefaultContentsWithoutAXM() function. More...
 
json FormIt.SetKeyboardShortcutsEnabled (enabled)
 SetKeyboardShortcutsEnabled Enables/Disables Keyboard Shortcuts Parameters: In: enabled Out: JSON_UNDEFINED. More...
 
json FormIt.GetShowEditableDimensions ()
 GetShowEditableDimensions returns true if editable dimensions are being displayed. More...
 
json FormIt.SetShowEditableDimensions (show)
 SetShowEditableDimensions sets if editable dimensions are being displayed. More...
 
json FormIt.GetVersion ()
 Retrieve the FormIt version number Parameters Out: FormIt.Version. More...
 
json FormIt.FindLatestVersion (versionJsonString, testVersion)
 Retrieve the latest version string from a plugin versions.json file passed as a string Parameters In: versionJsonString Out: The version json obj of the plugin to load. More...
 
json FormIt.ImportToGroup (sFileType, sFilePath)
 Import to a Group Parameters: In: string In: string Out: HistoryID. More...
 
json FormIt.CallJS (funcName, paramsJSON)
 Execute the given function with the given params Parameters function, params (json) Out: string. More...
 
json FormIt.SetLocaleForWeb (nameCode)
 Set the Locale for web client given locale type Parameters In string localType Out: undefined. More...
 
json FormIt.ConsoleLog (msg)
 Log the given msg to the FormIt console. More...
 
json FormIt.SetSendToRevitPreview (enabled)
 Set the Send to Revit preview mode state. More...
 
json FormIt.GetSendToRevitPreview ()
 Get the Send to Revit preview mode state. More...
 
json FormIt.SetNoInferenceSmoothEdgesAndPoints (enabled)
 Set the "No inferencing smooth edges and vertices" mode. More...
 
json FormIt.GetNoInferenceSmoothEdgesAndPoints ()
 Get the "No inferencing smooth edges and vertices" mode. More...
 
json FormIt.GetAsyncAPI ()
 Get the FormItAsync API. More...
 
json FormIt.RegisterAsyncAPI (NameSpace, APIName, Params)
 Register the given function for the async API For example: FormIt.RegisterAsyncAPI("HelloBlockAsync", "CreateBlock", "l, w, h"); This will expose an async API on the web side that can be called like: var result = await HelloBlockAsync.CreateBlock(l, w, h);. More...
 

Function Documentation

json FormIt.CallJS ( funcName  ,
paramsJSON   
)

Execute the given function with the given params Parameters function, params (json) Out: string.

Parameters
[in]funcNameString
[in]paramsJSONjson
Returns
scriptInstance->Evaluate(cmd)
json FormIt.ChangeTargetBuildableArea ( value  )

ChangeTargetBuildableArea() function.

Parameters
[in]valuedouble
Returns
JSON_UNDEFINED, i.e. {}
json FormIt.ConsoleLog ( msg  )

Log the given msg to the FormIt console.

Parameters msg Out: JSON_UNDEFINED

Parameters
[in]msgString
Returns
JSON_UNDEFINED, i.e. {}
json FormIt.DeleteImage ( nHistoryID  ,
imageID   
)

DeleteImage() function.

Parameters
[in]nHistoryIDint
[in]imageIDint
Returns
JSON_UNDEFINED, i.e. {}
json FormIt.FindLatestVersion ( versionJsonString  ,
testVersion   
)

Retrieve the latest version string from a plugin versions.json file passed as a string Parameters In: versionJsonString Out: The version json obj of the plugin to load.

Parameters
[in]versionJsonStringjson
[in]testVersion(OPTIONAL) FormIt.Version
Returns
FormIt.FindLatestVersion(versionJsonString, testVersion);
json FormIt.GetAccuracyForQuarterCircle ( accuracy  )

Get the accuracy for a quarter circle to be used to call SetCurveAccuracyOrCountDefault/SetSurfaceAccuracyOrCountDefault.

Parameters
[in]accuracy
  • The accuracy for a quarter circle that can be used to call
  • SetCurveAccuracyOrCountDefault/SetSurfaceAccuracyOrCountDefault
  • Should have a range of [3, 100]
[in]accuracydouble
Returns
accuracy
json FormIt.GetAppDefaultContentsWithoutAXM ( )

GetAppDefaultContentsWithoutAXM() function.

Returns
{...}
json FormIt.GetAsyncAPI ( )

Get the FormItAsync API.

Returns
string
json FormIt.GetBuildingType ( )

GetBuildingType() function.

Returns
{...}
json FormIt.GetCurveAccuracyOrCountDefault ( )

Get the curve accuracy for the application.

File->New will use this value.

Returns
Curve accuracy
json FormIt.GetNoInferenceSmoothEdgesAndPoints ( )

Get the "No inferencing smooth edges and vertices" mode.

Returns
bool
json FormIt.GetSendToRevitPreview ( )

Get the Send to Revit preview mode state.

Returns
bool
json FormIt.GetShowEditableDimensions ( )

GetShowEditableDimensions returns true if editable dimensions are being displayed.

Parameters: Out: bool

Returns
{...}
json FormIt.GetSnap ( )

Get snapping state.

Returns
true if snapping is on.
json FormIt.GetSurfaceAccuracyOrCountDefault ( )

Get the surface accuracy for the application.

File->New will use this value.

Returns
Surface accuracy
json FormIt.GetTimeNow ( )

Get the time.

Returns
The current time
json FormIt.GetTouchEnabled ( )

Are touch interactions enabled?

Returns
Returns true if touch interactions are enabled
json FormIt.GetUnitTypeDefault ( )

Get the Application (as opposed to Model) UnitType.

This is the UnitType used when creating a new Model.

Returns
UnitType
json FormIt.GetVersion ( )

Retrieve the FormIt version number Parameters Out: FormIt.Version.

Returns
{...}
json FormIt.HandleHUDTextInput ( dimensionID  ,
inputText   
)

HandleHUDTextInput will handle the HUD input values Parameters: In: dimensionID Out: Boolean.

Parameters
[in]dimensionIDint
[in]inputTextString
Returns
{...}
json FormIt.ImportFile ( sFileName  ,
bGroupImport  ,
nHistoryID  ,
bKeepLevelsWhenGrouping   
)

Imports the content of the given file.

If nHistoryID is provided import into that History, otherwise use the editing History. If bGroupImport is true, all top level objects are used to create a group and an instance of that group is placed in the history. Section planes, images, unused layers, unused materials and unused textures are not kept. Levels are not kept, unless bKeepLevelsWhenGrouping is also true. If bGroupImport is false, all top level objects are placed directly in the history and all object types from the imported file are kept.

Parameters
[in]sFileNameString
[in]bGroupImportbool Group imported file (OPTIONAL)
[in]nHistoryIDHistory to import into (OPTIONAL)
[in]bKeepLevelsbool if true levels are imported as well when bGroupImport is true. (OPTIONAL)
[in]bKeepLevelsWhenGrouping(OPTIONAL, default = false) bool
Returns
bool Success
json FormIt.ImportToGroup ( sFileType  ,
sFilePath   
)

Import to a Group Parameters: In: string In: string Out: HistoryID.

Parameters
[in]sFileTypeString
[in]sFilePathString
Returns
{...}
json FormIt.IsWSRAvailable ( )

IsWSRAvailable() function.

Returns
false
json FormIt.LoadPreviewImage ( sFileName  )

Load preview image of the given file.

Parameters
[in]sFileNameString
Returns
vector<char> Image
Parameters
[in]sFileNameString
Returns
{ { "Image" , to_json(img) }};
json FormIt.NewFile ( forced  )

Run the new file method.

Parameters
[in]forcedIf its forced (OPTIONAL)
Returns
JSON_UNDEFINED
json FormIt.OpenFile ( sFileName  )

Open the given file.

Parameters
[in]sFileNameString
Returns
bool Success
json FormIt.RegisterAsyncAPI ( NameSpace  ,
APIName  ,
Params   
)

Register the given function for the async API For example: FormIt.RegisterAsyncAPI("HelloBlockAsync", "CreateBlock", "l, w, h"); This will expose an async API on the web side that can be called like: var result = await HelloBlockAsync.CreateBlock(l, w, h);.

Parameters
[in]NameSpaceString
[in]APINameString
[in]ParamsString
Returns
JSON_UNDEFINED
json FormIt.ResumeMessaging ( )

Resumes messaging that was suspended by a call to SuspendMessaging.

Returns
JSON_UNDEFINED, i.e. {}
json FormIt.SaveFile ( sFileName  ,
saveOptions  ,
previewImage  ,
forSave   
)

Save the current model to the given file name.

Parameters
[in]sFileNameString
[in]saveOptions(OPTIONAL) FormIt.SaveOptions.AllObjectsWithHistory (default)
[in]previewImage(OPTIONAL) The preview image.
[in]forSave(OPTIONAL) set to true if doing a real save (not Export or Save A Copy As)
FormIt.SaveOptions-
FormIt.SaveOptions.AllObjects
FormIt.SaveOptions.AllObjectsWithHistory
FormIt.SaveOptions.VisibleOnly
FormIt.SaveOptions.SelectedOnly
FormIt.SaveOptions.SelectedOnlyWorldCoords
Returns
bool Success
json FormIt.SaveFileForEnergyAnalysis ( sFileName  )

Save the current model to the given file name for energy analysis.

The saved model will include only visible objects, all bodies will be merged, and no materials will be saved. This is not a "real" save, so the modified project flag will not be reset.

Parameters
[in]sFileNameString
Returns
bool Success
json FormIt.SetBuildingType ( value  )

SetBuildingType() function.

Parameters
[in]valueint
Returns
JSON_UNDEFINED, i.e. {}
json FormIt.SetCurveAccuracyOrCountDefault ( accuracyORcount  )

Set the curve accuracy for the application.

File->New will use this value.

Parameters
[in]accuracyORcount
  • MAX distance between base circle and segment as portion of R, if < .75
  • number of divisions (double rounded to int) over 90 degree arc, if >= .75
[in]accuracyORcountdouble
Returns
JSON_UNDEFINED
json FormIt.SetGeoLocationData ( geodata  )

SetGeoLocationData() function.

Parameters
[in]geodataWSM.GeoLocationData
Returns
false
json FormIt.SetKeyboardShortcutsEnabled ( enabled  )

SetKeyboardShortcutsEnabled Enables/Disables Keyboard Shortcuts Parameters: In: enabled Out: JSON_UNDEFINED.

Parameters
[in]enabledbool
Returns
JSON_UNDEFINED, i.e. {}
json FormIt.SetLocaleForWeb ( nameCode  )

Set the Locale for web client given locale type Parameters In string localType Out: undefined.

Parameters
[in]nameCodeString
Returns
JSON_UNDEFINED, i.e. {}
json FormIt.SetNoInferenceSmoothEdgesAndPoints ( enabled  )

Set the "No inferencing smooth edges and vertices" mode.

Parameters
[in]enabled
json FormIt.SetRenderData ( renderdata  )

SetRenderData() function.

Parameters
[in]renderdataWSM.RenderData
Returns
false ;
json FormIt.SetSendToRevitPreview ( enabled  )

Set the Send to Revit preview mode state.

Parameters
[in]enabled
json FormIt.SetShowEditableDimensions ( show  )

SetShowEditableDimensions sets if editable dimensions are being displayed.

Parameters: In: show Out: JSON_UNDEFINED

Parameters
[in]showbool
Returns
JSON_UNDEFINED, i.e. {}
json FormIt.SetSnap ( bSnap  )

Set snapping state.

Parameters
[in]bSnapbool
Returns
JSON_UNDEFINED
json FormIt.SetSurfaceAccuracyOrCountDefault ( accuracyORcount  )

Set the surface accuracy for the application.

File->New will use this value.

Parameters
[in]accuracyORcount
  • MAX distance between sphere and planar face as portion of R, if < .75
  • number of divisions (rounded double) over 90 degree arc, if >= .75
[in]accuracyORcountdouble
Returns
JSON_UNDEFINED
json FormIt.SetTouchEnabled ( bTouchEnabled  )

Enable touch interactions.

Parameters
[in]bTouchEnabledbool
Returns
JSON_UNDEFINED
json FormIt.SetUnitTypeDefault ( unitType  )

Set the Application (as opposed to Model) UnitType.

This is the UnitType used when creating a new Model.

Parameters
[in]FormIt.UnitType
json FormIt.SuspendMessaging ( bSuppress  ,
nTopLevelHistory  ,
bFullUpdate   
)

SuspendMessaging suspends all update messages from WSM until ResumeMessaging is called.

The top level history ID provided is included in the kLoadComplete message sent upon resume. This tells the receiver of the message into which history the load was done. The bSuppress parameter can be set to false to indicate that the object should not take effect. This is used to allow run-time determination. Parameters: In: bSuppress In: nTopLevelHistory (OPTIONAL) In: bFullUpdate Default to true to update everthing otherwise only the delta might be updated (OPTIONAL) Out: JSON_UNDEFINED

Parameters
[in]bSuppressbool
[in]nTopLevelHistory(OPTIONAL, default = WSM.INVALID_ID) int
[in]bFullUpdate(OPTIONAL, default = true) bool
Returns
JSON_UNDEFINED, i.e. {}
json FormIt.Version ( )

Get the version of FormIt.

Returns
Version DEPRECTATED. USE FormIt.GetVersion instead, which will translate the "version object" directly.
json FormIt.WriteAppDefaultContentToFile ( id  ,
path   
)

WriteAppDefaultContentToFile() function.

Parameters
[in]idString
[in]pathString
Returns
{...}