CE Update 13: Remove workflow from ribbon before import

During the porting from V8i to CE, we intent to use a specific custom workflow that will take the place of the goold old menu.

This workflow is created and loaded dynamically (it will even change when the user changes DGN).

In order to do so, we build an XML file and import it from within an MDL application.

There are 2 problems:

1)

An eventual existing workflow with the same name is not overwritten but some sort of duplication is created. We could call ribbon customizations revertall first, but that deletes all customizations and we don't want that. We just want to delete the workflow with that specific name (without the user being asked anything).

2)

The key-in ribbon customizations importecxml opens a dialog asking the user to enter the filename. If I pass the filename within the command, it just asks me if I want to import the xml into Personal.dgnlib and it doesn't add the workflow to the ribbon. We want to import an XML without the user being asked anything.

Any suggestions?

Thanks,

Robert Kock

Parents
  • Hi Robert,

    Jan is absolutely correct about the purpose of the XML files.

    Potentially simpler alternatives (depending on what you want to do) are:

    • Storing ribbon customisations in DGNLIBs that are included in/excluded from the MS_GUIDGNLIBLIST variable by configuration at the appropriate level.
    • Using named expressions (also in DGNLIBs) to show/hide tools according to context (as Jan mentioned).

    Regards

    Marc

  • OK. I got the point.

    So let's assume I compose the ribbon statically with all possible elements (tabs, groups, buttons, dropdown buttons, submenus) enabled.

    As soon as the user selects a DGN, I need to evaluate which items need to be shown/hidden/enabled/disabled. This depends on the permissions of the user and the DGN itself (for instance, another user may have opened the same DGN). This information is found in our database. The DGNs themselves are also stored in the DB and a DGN is download when the user selects it.

    I understand I need named expressions for this but in fact I would like to have some kind of callback that is invoked for each element.

    In the API documentation I found the functions mdlNamedExpression_EvaluateAs* but I'm not sure when and how these functions are called.

    Thanks,

    Robert

Reply
  • OK. I got the point.

    So let's assume I compose the ribbon statically with all possible elements (tabs, groups, buttons, dropdown buttons, submenus) enabled.

    As soon as the user selects a DGN, I need to evaluate which items need to be shown/hidden/enabled/disabled. This depends on the permissions of the user and the DGN itself (for instance, another user may have opened the same DGN). This information is found in our database. The DGNs themselves are also stored in the DB and a DGN is download when the user selects it.

    I understand I need named expressions for this but in fact I would like to have some kind of callback that is invoked for each element.

    In the API documentation I found the functions mdlNamedExpression_EvaluateAs* but I'm not sure when and how these functions are called.

    Thanks,

    Robert

Children