FormIt C++ API v25.0.0 (2025.0.0)
Loading...
Searching...
No Matches
FormIt Core API Reference List

Description

Namespaces

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

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.
 
#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.
 

Functions

FORMIT_CORE_EXPORT void FormIt::NewFile (bool forced=false)
 App level.
 
FORMIT_CORE_EXPORT FormIt::Version FormIt::GetVersion ()
 GetVersion() function.
 
FORMIT_CORE_EXPORT json FormIt::FindLatestVersion (const json &versionJson, FormIt::Version const &testVersion={})
 Get the latest version string from the given version.json.
 
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.
 
void FORMIT_CORE_EXPORT FormIt::ResumeMessaging ()
 Resume messaging.
 
FORMIT_CORE_EXPORT void FormIt::SetCurveAccuracyOrCountDefault (double accuracyORcount)
 Set the curve accuracy for the application.
 
FORMIT_CORE_EXPORT double FormIt::GetCurveAccuracyOrCountDefault ()
 Get the curve accuracy for the application.
 
FORMIT_CORE_EXPORT void FormIt::SetSurfaceAccuracyOrCountDefault (double accuracyORcount)
 Set the default surface accuracy.
 
FORMIT_CORE_EXPORT double FormIt::GetSurfaceAccuracyOrCountDefault ()
 Get the default surface accuracy.
 
FORMIT_CORE_EXPORT double FormIt::GetAccuracyForQuarterCircle (double accuracy)
 Get the accuracy for a quarter circle to be used to call SetCurveAccuracyOrCountDefault/SetSurfaceAccuracyOrCountDefault.
 
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 void FormIt::SetUnitTypeDefault (FormIt::UnitType unitType)
 Set the Application (as opposed to Model) UnitType.
 
FORMIT_CORE_EXPORT double FormIt::GetCameraTransitionDuration ()
 Get the duration of animated camera transition.
 
FORMIT_CORE_EXPORT void FormIt::SetCameraTransitionDuration (double duration)
 Set the duration of animated camera transition.
 
FORMIT_CORE_EXPORT bool FormIt::GetSendToRevitPreview ()
 Get/set the send to Revit preview mode state.
 
FORMIT_CORE_EXPORT void FormIt::SetSendToRevitPreview (bool enabled)
 SetSendToRevitPreview() function.
 
FORMIT_CORE_EXPORT bool FormIt::GetNoInferenceSmoothEdgesAndPoints ()
 Get/set the no inferencing to smoothy edges and vertices mode.
 
FORMIT_CORE_EXPORT void FormIt::SetNoInferenceSmoothEdgesAndPoints (bool enabled)
 SetNoInferenceSmoothEdgesAndPoints() function.
 
FORMIT_CORE_EXPORT bool FormIt::HandleHUDTextInput (size_t widgetID, 1::string input)
 Handle HUD canvas input text used in Dimension angle dialog box.
 
FORMIT_CORE_EXPORT void FormIt::SetKeyboardShortcutsEnabled (bool val)
 Enable/Disable Keyboard Shortcuts.
 
FORMIT_CORE_EXPORT bool FormIt::GetShowEditableDimensions ()
 GetShowEditableDimensions returns true if editable dimensions are being displayed.
 
FORMIT_CORE_EXPORT void FormIt::SetShowEditableDimensions (bool val)
 SetShowEditableDimensions sets if editable dimensions are being displayed.
 
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.
 
FORMIT_CORE_EXPORT bool FormIt::OpenFile (1::string const &path)
 Open the given file.
 
FORMIT_CORE_EXPORT bool FormIt::SaveFileForEnergyAnalysis (1::string const &path)
 Save the current model to the given file name for energy analysis.
 
FORMIT_CORE_EXPORT ::string FormIt::GetCurrentFileName ()
 Get the current model's file name.
 
FORMIT_CORE_EXPORT ::vector< char > FormIt::LoadPreviewImage (1::string const &sFileName)
 Get preview image from axm file.
 
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.
 
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.
 
FORMIT_CORE_EXPORT void FormIt::SetPickrayApertureScale (double scaleFactor)
 Set the pickray aperture scale factor.
 
FORMIT_CORE_EXPORT double FormIt::GetPickrayApertureScale ()
 Get the pickray aperture scale factor.
 
using FormIt::StringType = 1::string_t
 

Macro Definition Documentation

◆ DECLARE_MESSAGE

#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;
This structure hides the implementation of the payload so it can't be used improperly.
Definition FormItMessaging.h:35
virtual ::string message() const =0
message() function.
The base class for all structures that have a payload.
Definition FormItMessaging.h:48

◆ DECLARE_MESSAGE_VOID

#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;
Type
Definition FormItCoreTypes.h:1050
The base class for all structures that don't have a payload.
Definition FormItMessaging.h:62

◆ DEFINE_MESSAGE

#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;}

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_MESSAGE_VOID

#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

◆ StringType

using FormIt::StringType = typedef 1::string_t

Function Documentation

◆ FindLatestVersion()

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

◆ GetAccuracyForQuarterCircle()

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]

◆ GetCameraTransitionDuration()

FORMIT_CORE_EXPORT double FormIt::GetCameraTransitionDuration ( )

Get the duration of animated camera transition.

◆ GetCurrentFileName()

FORMIT_CORE_EXPORT ::string FormIt::GetCurrentFileName ( )

Get the current model's file name.

◆ GetCurveAccuracyOrCountDefault()

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

◆ GetNoInferenceSmoothEdgesAndPoints()

FORMIT_CORE_EXPORT bool FormIt::GetNoInferenceSmoothEdgesAndPoints ( )

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

◆ GetPickrayApertureScale()

FORMIT_CORE_EXPORT double FormIt::GetPickrayApertureScale ( )

Get the pickray aperture scale factor.

◆ GetSendToRevitPreview()

FORMIT_CORE_EXPORT bool FormIt::GetSendToRevitPreview ( )

Get/set the send to Revit preview mode state.

◆ GetShowEditableDimensions()

FORMIT_CORE_EXPORT bool FormIt::GetShowEditableDimensions ( )

GetShowEditableDimensions returns true if editable dimensions are being displayed.

HAS SC

◆ GetSurfaceAccuracyOrCountDefault()

FORMIT_CORE_EXPORT double FormIt::GetSurfaceAccuracyOrCountDefault ( )

Get the default surface accuracy.

◆ GetUnitTypeDefault()

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.

◆ GetVersion()

FORMIT_CORE_EXPORT FormIt::Version FormIt::GetVersion ( )

GetVersion() function.

◆ HandleHUDTextInput()

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

◆ ImportToGroup()

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

◆ LoadPreviewImage()

FORMIT_CORE_EXPORT ::vector< char > FormIt::LoadPreviewImage ( 1::string const &  sFileName)

Get preview image from axm file.

Parameters
[in]sFileName

◆ NewFile()

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.

◆ OpenFile()

FORMIT_CORE_EXPORT bool FormIt::OpenFile ( 1::string const &  path)

Open the given file.

Parameters
[in]path

◆ ResumeMessaging()

void FORMIT_CORE_EXPORT FormIt::ResumeMessaging ( )

Resume messaging.

◆ SaveFile()

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

◆ SaveFileForEnergyAnalysis()

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

◆ SetCameraTransitionDuration()

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

◆ SetCurveAccuracyOrCountDefault()

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

◆ SetKeyboardShortcutsEnabled()

FORMIT_CORE_EXPORT void FormIt::SetKeyboardShortcutsEnabled ( bool  val)

Enable/Disable Keyboard Shortcuts.

Parameters
[in]val

◆ SetLocaleForWeb()

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

◆ SetNoInferenceSmoothEdgesAndPoints()

FORMIT_CORE_EXPORT void FormIt::SetNoInferenceSmoothEdgesAndPoints ( bool  enabled)

SetNoInferenceSmoothEdgesAndPoints() function.

Parameters
[in]enabled

◆ SetPickrayApertureScale()

FORMIT_CORE_EXPORT void FormIt::SetPickrayApertureScale ( double  scaleFactor)

Set the pickray aperture scale factor.

The range can be .5 <-> 1.5 and is clamped.

Parameters
[in]scaleFactor

◆ SetSendToRevitPreview()

FORMIT_CORE_EXPORT void FormIt::SetSendToRevitPreview ( bool  enabled)

SetSendToRevitPreview() function.

Parameters
[in]enabled

◆ SetShowEditableDimensions()

FORMIT_CORE_EXPORT void FormIt::SetShowEditableDimensions ( bool  val)

SetShowEditableDimensions sets if editable dimensions are being displayed.

HAS SC

Parameters
[in]val

◆ SetSurfaceAccuracyOrCountDefault()

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

◆ SetUnitTypeDefault()

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

◆ SuspendMessaging()

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