fbx export settings

Hi All,  I'm trying to tick the "Invert Y and Z" checkbox with VBA in the "FBX Export Settings" dialog box.

When I close the dialog box manually, the setting is remembered next time the dialog box opens.  But if I close the dialog using VBA then the setting is forgotten.  does anyone know how can I get microstation to remember this setting?

I'm using the keyin "dialog fbx"  to open the dialog box,  and the modalhandler to check the option and then close the dialog box.

If DialogBoxName = "FBX Export Settings" Then

    '   Set a variable associated with a dialog box
    '   This only modifies a few bits of the variable it changes. It first
    '   creates a mask for clearing the bits it will change. Then it gets
    '   the variable and uses the mask to clear those bits. Finally
    '   it sets the desired bits in the value and saves the updated value.
        lngTemp = Not 1
        lngTemp = GetCExpressionValue("fbxExportSettings.m_flags.m_invertYZ", "FBXEXPORT") And lngTemp
        SetCExpressionValue "fbxExportSettings.m_flags.m_invertYZ", lngTemp Or 1, "FBXEXPORT"

    '   Remove the following line to let the user close the dialog box.
        DialogResult = msdDialogBoxResultOK

    End If  ' FBX Export Settings

Parents Reply Children
  • The only way I can get the box to be ticked is by having no code after the SetCExpressionValue line

    Wacky!  I'm impressed that you discovered the problem.

    Any suggestions? 

    We have to tolerate the idiosyncrasies of VBA.  It is, after all, a relic of the last century.  Bentley Systems take the Microsoft VBA library and add bits for MicroStation.  The core, which includes modal dialog handling, is as Microsoft designed it.  Microsoft has declared VBA obsolete several times, but it lingers in Microsoft Office, so it's unlikely to vanish in the near future.

    That said, Microsoft would prefer us all to move to .NET, which is a first-class API in MicroStation CONNECT.

    Regards, Jon Summers
    LA Solutions