/
Migrating to FRX

Migrating to FRX

This page was created to guide API developers through possible incompatibilities between FxARX SDK and other CAD SDKs as well as architecture limitations, and how they can overcome such problems offering workarounds or alternative solutions.

1. Read/Update the Profile

ARES Commander doesn’t store the profile in the registry. Instead, it is saved in a XML file in the ARES Commander %APPDATA% folder.

We provide an API in FxARX to read and write profile:

AcApProfileManager::ProfileGetKeyValue //to read a profile setting AcApProfileManager::ProfileSetKeyValue //to update a profile setting

In both methods, the first parameter is the profile name. In the second parameter, you will specify the profile setting. Please, review the profile.xml to understand the root of each setting. For example to modify/read the profile support paths, you will use:

"/files/support_paths"

or for font paths:

"/files/fonts_paths"

Following code shows how to add programmatically a path to the support paths of the current profile:

 

2. Native MDI window functions

As the native MFC functions that you can use in FRX projects for operations such as maximizing, minimizing, and restoring the MDI window run into conflict with Qt events, the MDI window will not be updated properly. To avoid such situation, please replace:

  • CMDIFrameWnd::MDIMaximize

  • CMDIFrameWnd::MDIMinimize

  • CMDIFrameWnd::MDIRestore

  • Move MDI window

  • Restore MDI window functionality

and use the methods that FxARX API provides:

void MDIMaximize(CWnd* param_1)

void MDIMinimize(CWnd* param_1)

void MDIRestore(CWnd* param_1)

void MDIMoveWindow( CWnd* param_1, const CRect & rect )

For arranging the child windows of the MDI client, use:

void MDITile(int param_1); // 0 = vertical arragement, 1 = horizontal arrangement
void MDICascade();

 

3. Replace MFC native CStatusBar with CFxUiStatusBar

The use of native MFC CStatusBar objects inside ARES Commander main frame, could run into conflicts with Qt event processing for that kind of controls. Therefore, FxARX API provides the CFxUiStatusBar interface as replacement for the CStatusBar functionality and handles such situations properly.

The following code:

Should be replaced with the following code:

 

4. ControlBar/PaletteSet docking and floating status

Do not use native MFC functions to change the status of the FRX DockControlBars. Instead of that, to dock or make the control floating use the function that FxARX SDK provides:

4.1 Floating dock control bar

Example: Your DockControlBar inherits from CAcUiDockControlBar

To avoid following case:

It should be written like:

5. Reading AcDbObjects that are already closed

We strongly recommend to not access to closed objects. Please, get object information before they have been closed.

Example, avoid following case:

it should be written like:

 

6. New AcDbTextStyleTableRecord::setFont method not supported

Currently, we don't support the function:

but it is replaced with the function:

Following code shows how to use the function:

 

Similar situation can be applied to:

which it is not currently supported, but instead can be used:

 

7. GsView changes

Currently, we are not supporting AcGsModel Object caching facility to client. Besides that we render the objects on client screen by creating different GsDevice and GsView. For this reason, we recommend to call the update of the GsDevice when the GsView is invalidated:

Another change is when it is use the function AcGsView::dolly:

 

8. AcDbFaceRecord class inheritance

In FxARX context, AcDbFaceRecord inherits from AcDbEntity, while in other platforms the base class is AcDbVertex. Add support in FRX configuration to avoid such situations. E.g:

A possible workaround:

 

9. Update multiple documents

In other CAD platforms, you can update non active document by following the next code:

ARES Commander has a limitation on updating non active document. Currently you cannot update those document windows. So, if you want to update the MDI window, you need to activate first the document (setCurDocument 3rd parameter).

ActivateDocsFull.mp4

 

10. Do not directly delete a void*

In C++, a void* pointer is a generic pointer type that can point to any data type. However, because it is type-agnostic, you cannot directly delete a void* pointer using delete or delete[] because the compiler does not know what type of object it points to, and thus cannot call the appropriate destructor.

Please make sure you cast void* Back to its original type or inheritance:

 

11. No support for modules created for other CAD applications

Do not try to load modules that are not compiled with ARES supported SDKs. They will fail to load in ARES. Please, share with the API team which modules from other CAD applications, the plugin tries to load.

Please avoid the use of

for the libs that are not built under FxARX SDK.

Related content

Compiling ObjectARX® Application Against FRX SDK
Compiling ObjectARX® Application Against FRX SDK
More like this
FRX Frequently Asked Questions
FRX Frequently Asked Questions
Read with this
ARES Commander Plugin Project templates
ARES Commander Plugin Project templates
More like this
Frequently Asked Questions (CFx)
Frequently Asked Questions (CFx)
Read with this