[V8i SS3 VBA] Unable to Record 'Save As' with Fence Filter

Manually Save As with Fence Filter works as expected

If I Save As manually, and invoke the Options to set a fence filter, things progress as expected.  I end up with a new DGN file whose default model contains elements copied from the contents of the fence in the original file.

Recorded VBA Macro fails to record all settings to Save As with Fence Filter

When I record that same process using the VBA macro recorder, then replay the recording, the fence is not processed.  The playback creates a new file of the correct name but its contents are the entire contents of the original.  In other words, it ignores (or rather, fails to record) the fence filter setting.

Has anyone experienced this problem?  Has anyone solved this problem?

I've noticed one error in the recording.  The recording creates a procedure (Macro1 or similar) and declares variable lngTemp As Long in that procedure.  But lngTemp is not used there.  The recording creates a class that Implements IModalDialogEvents.  The _OnDialogOpened event of that class uses, but fails to declare, variable lngTemp.  What else may have been missed?

Here's the code from the class that deals with the filter settings.  I don't see where it records that I want a fence filter...

    If DialogBoxName = "Save As V8 Options" Then

    '   Set a variable associated with a dialog box
        SetCExpressionValue "gFilterGlobals.subset", 1, "SAVEASFILTER"

    '   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.
        Dim lngTemp As Long ' Declaration inserted manually
        lngTemp = Not 1
        lngTemp = GetCExpressionValue("gFilterOptions->flags.filterACS", "SAVEASFILTER") And lngTemp
        SetCExpressionValue "gFilterOptions->flags.filterACS", lngTemp Or 1, "SAVEASFILTER"

        lngTemp = Not 1
        lngTemp = GetCExpressionValue("gFilterOptions->flags.filterNamedViews", "SAVEASFILTER") And lngTemp
        SetCExpressionValue "gFilterOptions->flags.filterNamedViews", lngTemp Or 1, "SAVEASFILTER"

        lngTemp = Not 1
        lngTemp = GetCExpressionValue("gFilterOptions->flags.filterSharedCellInstances", "SAVEASFILTER") And lngTemp
        SetCExpressionValue "gFilterOptions->flags.filterSharedCellInstances", lngTemp Or 1, "SAVEASFILTER"

        lngTemp = Not 1
        lngTemp = GetCExpressionValue("gFilterOptions->flags.filterUnusedSharedCellDefs", "SAVEASFILTER") And lngTemp
        SetCExpressionValue "gFilterOptions->flags.filterUnusedSharedCellDefs", lngTemp Or 1, "SAVEASFILTER"

        lngTemp = Not 1
        lngTemp = GetCExpressionValue("gFilterOptions->flags.filterTags", "SAVEASFILTER") And lngTemp
        SetCExpressionValue "gFilterOptions->flags.filterTags", lngTemp Or 1, "SAVEASFILTER"

        lngTemp = Not 1
        lngTemp = GetCExpressionValue("gFilterOptions->flags.filterFrozenLevels", "SAVEASFILTER") And lngTemp
        SetCExpressionValue "gFilterOptions->flags.filterFrozenLevels", lngTemp Or 1, "SAVEASFILTER"

        lngTemp = Not 1
        lngTemp = GetCExpressionValue("gFilterOptions->flags.filterNamedGroups", "SAVEASFILTER") And lngTemp
        SetCExpressionValue "gFilterOptions->flags.filterNamedGroups", lngTemp Or 1, "SAVEASFILTER"

        CadInputQueue.SendCommand "LOCK FENCE INSIDE"

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

    End If  ' Save As V8 Options
Parents Reply Children
No Data