FormIt C++ API  v23.0.0 (2023.0.0)
FormIt Core API Reference List

Description

Namespaces

 FormIt::StringConversion
 
 FormIt::Model
 
 FormIt::GroupEdit
 
 FormIt::ImageManager
 
 FormIt::Levels
 
 FormIt::Commands
 TODO(hauswij): These should really be in Shortcuts.
 
 FormIt::SectionPlanes
 
 FormIt::Shortcuts
 
 FormIt::Tools
 Tools API.
 
 FormIt::Cameras
 
 FormIt::View
 
 FormIt::Graphics
 
 FormIt::VisualStyles
 Graphics and display specific functionality and settings.
 
 FormIt::Selection
 
 FormIt::Clipboard
 
 FormIt::Analysis
 
 FormIt::Scenes
 
 FormIt::Layers
 
 FormIt::MaterialProvider
 Material Provider APIs.
 
 FormIt::SketchMaterials
 
 FormIt::SampleMaterials
 
 FormIt::UI
 
 FormIt::UndoManagement
 
 FormIt::Files
 
 FormIt::Forge
 
 FormIt::Dynamo
 
 FormIt::SunAndLocation
 
 FormIt::Utils
 

Classes

struct  FormIt::kArrayToolRequestType
 Request Array Tool. More...
 
struct  FormIt::MessageStruct
 The base class for all messages. More...
 
struct  FormIt::MessagePayloadStruct
 This structure hides the implementation of the payload so it can't be used improperly. More...
 
struct  FormIt::MessageWithPayloadStruct
 The base class for all structures that have a payload. More...
 
struct  FormIt::MessageVoidStruct
 The base class for all structures that don't have a payload. More...
 
class  FormIt::MessageBroadcaster
 FormIt::MessageBroadcaster class. More...
 
class  FormIt::MessageListener
 FormIt::MessageListener class. More...
 

Macros

#define DECLARE_MESSAGE(EXPORT_NAME, name, ...)
 
#define DEFINE_MESSAGE(classname, name)
 The = {} here is required due to a defect (253) in the C++ standard. More...
 
#define DECLARE_MESSAGE_VOID(EXPORT_NAME, name)
 
#define DEFINE_MESSAGE_VOID(classname, name)    const classname::name##Type classname::name = {}
 The = {} here is required due to a defect (253) in the C++ standard. More...
 

Functions

FORMIT_CORE_EXPORT void FormIt::NewFile (bool forced=false)
 App level. More...
 
FORMIT_CORE_EXPORT FormIt::Version FormIt::GetVersion ()
 GetVersion() function. More...
 
FORMIT_CORE_EXPORT json FormIt::FindLatestVersion (const json &versionJson, FormIt::Version const &testVersion={})
 Get the latest version string from the given version.json. More...
 
void FORMIT_CORE_EXPORT FormIt::SuspendMessaging (bool bSuppress, size_t nTopLevelHistory=WSM::INVALID_ID, bool bFullUpdate=true)
 SuspendMessaging suspends all update messages from WSM until ResumeMessaging is called. More...
 
void FORMIT_CORE_EXPORT FormIt::ResumeMessaging ()
 Resume messaging. More...
 
FORMIT_CORE_EXPORT void FormIt::SetCurveAccuracyOrCountDefault (double accuracyORcount)
 Set the curve accuracy for the application. More...
 
FORMIT_CORE_EXPORT double FormIt::GetCurveAccuracyOrCountDefault ()
 Get the curve accuracy for the application. More...
 
FORMIT_CORE_EXPORT void FormIt::SetSurfaceAccuracyOrCountDefault (double accuracyORcount)
 Set the default surface accuracy. More...
 
FORMIT_CORE_EXPORT double FormIt::GetSurfaceAccuracyOrCountDefault ()
 Get the default surface accuracy. More...
 
FORMIT_CORE_EXPORT double FormIt::GetAccuracyForQuarterCircle (double accuracy)
 Get the accuracy for a quarter circle to be used to call SetCurveAccuracyOrCountDefault/SetSurfaceAccuracyOrCountDefault. More...
 
FORMIT_CORE_EXPORT FormIt::UnitType FormIt::GetUnitTypeDefault ()
 Get the Application (as opposed to Model) UnitType. This is the UnitType used when creating a new Model. More...
 
FORMIT_CORE_EXPORT void FormIt::SetUnitTypeDefault (FormIt::UnitType unitType)
 Set the Application (as opposed to Model) UnitType. More...
 
FORMIT_CORE_EXPORT double FormIt::GetCameraTransitionDuration ()
 Get the duration of animated camera transition. More...
 
FORMIT_CORE_EXPORT void FormIt::SetCameraTransitionDuration (double duration)
 Set the duration of animated camera transition. More...
 
FORMIT_CORE_EXPORT bool FormIt::GetSendToRevitPreview ()
 Get/set the send to Revit preview mode state. More...
 
FORMIT_CORE_EXPORT void FormIt::SetSendToRevitPreview (bool enabled)
 SetSendToRevitPreview() function. More...
 
FORMIT_CORE_EXPORT bool FormIt::GetNoInferenceSmoothEdgesAndPoints ()
 Get/set the no inferencing to smoothy edges and vertices mode. More...
 
FORMIT_CORE_EXPORT void FormIt::SetNoInferenceSmoothEdgesAndPoints (bool enabled)
 SetNoInferenceSmoothEdgesAndPoints() function. More...
 
FORMIT_CORE_EXPORT bool FormIt::HandleHUDTextInput (size_t widgetID, 1::string input)
 Handle HUD canvas input text used in Dimension angle dialog box. More...
 
FORMIT_CORE_EXPORT void FormIt::SetKeyboardShortcutsEnabled (bool val)
 Enable/Disable Keyboard Shortcuts. More...
 
FORMIT_CORE_EXPORT bool FormIt::GetShowEditableDimensions ()
 GetShowEditableDimensions returns true if editable dimensions are being displayed. More...
 
FORMIT_CORE_EXPORT void FormIt::SetShowEditableDimensions (bool val)
 SetShowEditableDimensions sets if editable dimensions are being displayed. More...
 
FORMIT_CORE_EXPORT bool FormIt::SaveFile (1::string const &path, SaveOptions saveOptions, const 1::vector< char > &previewImage={}, bool forSave=false, const FormIt::Files::FileOptions *exportOptions=nullptr)
 Save the current model to the given file name. More...
 
FORMIT_CORE_EXPORT bool FormIt::OpenFile (1::string const &path)
 Open the given file. More...
 
FORMIT_CORE_EXPORT bool FormIt::SaveFileForEnergyAnalysis (1::string const &path)
 Save the current model to the given file name for energy analysis. More...
 
FORMIT_CORE_EXPORT::string FormIt::GetCurrentFileName ()
 Get the current model's file name. More...
 
FORMIT_CORE_EXPORT::vector< char > FormIt::LoadPreviewImage (1::string const &sFileName)
 Get preview image from axm file. More...
 
FORMIT_CORE_EXPORT size_t FormIt::ImportToGroup (1::string const &fileType, 1::string const &filePath)
 Import to a Group we need to pass in the file type we need to pass in the filepath this return a reference ID. More...
 
FORMIT_CORE_EXPORT void FormIt::SetLocaleForWeb (1::string const &nameCode)
 Set the local for web we need to pass in the localtype this return a void. More...
 
using FormIt::StringType = 1::string_t
 

Macro Definition Documentation

#define DECLARE_MESSAGE (   EXPORT_NAME,
  name,
  ... 
)
Value:
struct name##Type : public FormIt::MessageWithPayloadStruct \
{ \
using Payload = __VA_ARGS__; \
EXPORT_NAME const Payload &extract( \
FormIt::MessagePayloadStruct const &payload) const; \
EXPORT_NAME std::string message() const override;\
}; \
extern EXPORT_NAME const name##Type name;
virtual ::string message() const =0
message() function.
The base class for all structures that have a payload.
Definition: FormItMessaging.h:46
Type
Definition: FormItCoreTypes.h:1071
This structure hides the implementation of the payload so it can&#39;t be used improperly.
Definition: FormItMessaging.h:35
#define DECLARE_MESSAGE_VOID (   EXPORT_NAME,
  name 
)
Value:
struct name##Type : public FormIt::MessageVoidStruct { \
std::string message() const override \
{return std::string{"FormIt.Message."} + #name;} \
}; \
extern EXPORT_NAME const name##Type name;
virtual ::string message() const =0
message() function.
Type
Definition: FormItCoreTypes.h:1071
The base class for all structures that don&#39;t have a payload.
Definition: FormItMessaging.h:55
#define DEFINE_MESSAGE (   classname,
  name 
)
Value:
const classname::name##Type classname::name = {}; \
const classname::name##Type::Payload & \
classname::name##Type::extract( \
FormIt::MessagePayloadStruct const &payload) const \
{ return cast<Payload>(payload); } \
std::string classname::name##Type::message() const \
{return std::string{"FormIt.Message."} + #name;}
Type
Definition: FormItCoreTypes.h:1071
This structure hides the implementation of the payload so it can&#39;t be used improperly.
Definition: FormItMessaging.h:35

The = {} here is required due to a defect (253) in the C++ standard.

MSVC and gcc have implemented the fix, but Clang has not.

#define DEFINE_MESSAGE_VOID (   classname,
  name 
)    const classname::name##Type classname::name = {}

The = {} here is required due to a defect (253) in the C++ standard.

MSVC and gcc have implemented the fix, but Clang has not.

Typedef Documentation

using FormIt::StringType = typedef 1::string_t

Function Documentation

FORMIT_CORE_EXPORT json FormIt::FindLatestVersion ( const json &  versionJson,
FormIt::Version const &  testVersion = {} 
)

Get the latest version string from the given version.json.

Parameters
[in]versionJsonString
  • Force the creation of a new file without asking to save the file.
[in]versionJson
[in]testVersion
FORMIT_CORE_EXPORT double FormIt::GetAccuracyForQuarterCircle ( double  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]
FORMIT_CORE_EXPORT double FormIt::GetCameraTransitionDuration ( )

Get the duration of animated camera transition.

FORMIT_CORE_EXPORT ::string FormIt::GetCurrentFileName ( )

Get the current model's file name.

FORMIT_CORE_EXPORT double FormIt::GetCurveAccuracyOrCountDefault ( )

Get the curve accuracy for the application.

Any new Models created will use this accuracy.

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
FORMIT_CORE_EXPORT bool FormIt::GetNoInferenceSmoothEdgesAndPoints ( )

Get/set the no inferencing to smoothy edges and vertices mode.

FORMIT_CORE_EXPORT bool FormIt::GetSendToRevitPreview ( )

Get/set the send to Revit preview mode state.

FORMIT_CORE_EXPORT bool FormIt::GetShowEditableDimensions ( )

GetShowEditableDimensions returns true if editable dimensions are being displayed.

HAS SC

FORMIT_CORE_EXPORT double FormIt::GetSurfaceAccuracyOrCountDefault ( )

Get the default surface accuracy.

FORMIT_CORE_EXPORT FormIt::UnitType FormIt::GetUnitTypeDefault ( )

Get the Application (as opposed to Model) UnitType. This is the UnitType used when creating a new Model.

FORMIT_CORE_EXPORT FormIt::Version FormIt::GetVersion ( )

GetVersion() function.

FORMIT_CORE_EXPORT bool FormIt::HandleHUDTextInput ( size_t  widgetID,
1::string  input 
)

Handle HUD canvas input text used in Dimension angle dialog box.

Parameters
[in]widgetID
[in]input
FORMIT_CORE_EXPORT size_t FormIt::ImportToGroup ( 1::string const &  fileType,
1::string const &  filePath 
)

Import to a Group we need to pass in the file type we need to pass in the filepath this return a reference ID.

Parameters
[in]fileType
[in]filePath
FORMIT_CORE_EXPORT ::vector<char> FormIt::LoadPreviewImage ( 1::string const &  sFileName)

Get preview image from axm file.

Parameters
[in]sFileName
FORMIT_CORE_EXPORT void FormIt::NewFile ( bool  forced = false)

App level.

Create a new file.

Parameters
[in]forced
  • Force the creation of a new file without asking to save the file.
FORMIT_CORE_EXPORT bool FormIt::OpenFile ( 1::string const &  path)

Open the given file.

Parameters
[in]path
void FORMIT_CORE_EXPORT FormIt::ResumeMessaging ( )

Resume messaging.

FORMIT_CORE_EXPORT bool FormIt::SaveFile ( 1::string const &  path,
SaveOptions  saveOptions,
const 1::vector< char > &  previewImage = {},
bool  forSave = false,
const FormIt::Files::FileOptions exportOptions = nullptr 
)

Save the current model to the given file name.

"forSave" should be set to true when doing a real Save which will reset the project modified flag. WHen left as false the project modified flag will not be cleared

Parameters
[in]path
[in]saveOptions
[in]previewImage
[in]forSave
[in]exportOptions
FORMIT_CORE_EXPORT bool FormIt::SaveFileForEnergyAnalysis ( 1::string const &  path)

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]path
FORMIT_CORE_EXPORT void FormIt::SetCameraTransitionDuration ( double  duration)

Set the duration of animated camera transition.

If set to zero or less no transition is performed. Should be kept at a reasonable limit (1 second max?)

Parameters
[in]duration
FORMIT_CORE_EXPORT void FormIt::SetCurveAccuracyOrCountDefault ( double  accuracyORcount)

Set the curve accuracy for the application.

Any new Models created will use this accuracy.

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
FORMIT_CORE_EXPORT void FormIt::SetKeyboardShortcutsEnabled ( bool  val)

Enable/Disable Keyboard Shortcuts.

Parameters
[in]val
FORMIT_CORE_EXPORT void FormIt::SetLocaleForWeb ( 1::string const &  nameCode)

Set the local for web we need to pass in the localtype this return a void.

Parameters
[in]nameCode
FORMIT_CORE_EXPORT void FormIt::SetNoInferenceSmoothEdgesAndPoints ( bool  enabled)

SetNoInferenceSmoothEdgesAndPoints() function.

Parameters
[in]enabled
FORMIT_CORE_EXPORT void FormIt::SetSendToRevitPreview ( bool  enabled)

SetSendToRevitPreview() function.

Parameters
[in]enabled
FORMIT_CORE_EXPORT void FormIt::SetShowEditableDimensions ( bool  val)

SetShowEditableDimensions sets if editable dimensions are being displayed.

HAS SC

Parameters
[in]val
FORMIT_CORE_EXPORT void FormIt::SetSurfaceAccuracyOrCountDefault ( double  accuracyORcount)

Set the default surface accuracy.

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
FORMIT_CORE_EXPORT void FormIt::SetUnitTypeDefault ( FormIt::UnitType  unitType)

Set the Application (as opposed to Model) UnitType.

This is the UnitType used when creating a new Model.

Parameters
[in]unitType
void FORMIT_CORE_EXPORT FormIt::SuspendMessaging ( bool  bSuppress,
size_t  nTopLevelHistory = WSM::INVALID_ID,
bool  bFullUpdate = true 
)

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. The bFullUpdate can be set to false so that only modified that will be updated.

Parameters
[in]bSuppress
[in]nTopLevelHistory
[in]bFullUpdate