6.2. Add buttons to UI

Add buttons to the /libs/pappserver/webapps/3dfindit-enterprise/custom_config.json

[Note]Note

As of V12.6 changes have to be stored under $CADENAS_SITESETUP/3df/custom_config.json.

Default configuration and additional code will be merged.

Before the update you should save the file custom_config.json or store under $CADENAS_SITESETUP/3df. The file should only contain the changes.

The config contains a main section with some standard settings for 3Dfindit and then a toolbars section.

A toolbar button can be shown above the table or above the 3D view. This is defined in the viewer / table items.

The buttons itself and their functionality is defined in the buttons section. Each button has a type which can be JS or VBS:

  • JS is executed directly in the browser. It could only access browser functions, e.g. call other websites or APIs.

  • VBS is executed server sided and in the AppServer space.

Each button has an icon and a name.

{
  "baseApiPath": "",
  "basename": "/webapps/3dfindit-enterprise",
  "erp": true,
  "startRoute": "CadBim",
  "isEnterprise": true,

  "toolbars": {
    "viewer": ["exampleButton"],
    "table": ["exampleVBSButton"],
    "buttons": {
      "exampleButton": {
        "type": "JS",
        "name": {
          "de-DE": "JS Beispiel",
          "en-GB": "JS Example"
        },
        "callback": "onExampleButtonClicked",
        "icon": "images/bell-solid.svg",
        "tooltip": {
          "de-DE": "JS Beispiel",
          "en-GB": "JS Example"
        }
      },
      "exampleVBSButton": {
        "type": "VBS",
        "icon": "images/bell-solid.svg",
        "name": {
          "de-DE": "VBS Beispiel",
          "en-GB": "VBS Example"
        },
        "script": "/plugins/vbb/wstest.vbs",
        "requestFromPdm": "currentuser",
        "tooltip": {
          "de-DE": "VBS Beispiel",
          "en-GB": "VBS Example"
        }
      }
    }
  }
}