CADViewer Technical Documentation, Installation Guide and Reference Samples Library

Custom Icon Menu & Commands

Please read the section Menu Layout and Language Settings first.

In CADViewer, there are built 20 placeholders for Icon menu commands that the application programmer can use to add their own interactive Menus.

The commands can be inserted into the XML configuration menu at a location of choice, and their corresponding pop-up text is set in sequential order at the tag.

Sample XML Structure
            <!-- ... -->
            <tooltip>Commmand tooltip 1</tooltip>
            <!-- ... -->
            <tooltip>Commmand tooltip 20</tooltip>
Sample XML configuration file with custom icon menus

The XML configuration file is loaded up server side with the following call:

cvjs_setTopMenuXML("floorPlan", "cadviewer_menu_all_items_custom_commands.xml", "/cadviewer/app/cv/cv-pro/menu_config/");

Download XML configuration menu with custom commands: cadviewer_menu_all_items_custom_commands.xml.

Custom command Image location

The custom command icons are initial blank, but application programmers can freely change their content.

CADViewer 7

The location of the custom commands are in:


folder, they are named base200x200_01.svg through base200_200_20.svg .

Application programmers can exchange them freely.

CADViewer 6

The location of the custom commands are in


folder, they are named bcvjsIcon_customCommand_01.png through cvjsIcon_customCommand_20.png .

Application programmers can exchange them freely.

The custome command are invoked when clicking on the icon image.

Custom Icon Command

Implementation of Custom Commands

Top level Standard JavaScript class

In the standard JavaScript class download, the custom commands are implemented in:


The application programmer can freely change the content of the JavaScript methods and the icon files.

npm Installer for frame-works

When using Custom Commands inside a framework (ReactJS, Angular, VueJS), each command needs to be declared and referenced as a callback method:

function cvjs_customCommand_01(){
	window.alert("Hello click! cvjs_customCommand_01");
// with an associated callback method declaration
        cadviewer.cvjs_setCallbackMethod("cvjs_customCommand_01", cvjs_customCommand_01);

The application programmer fully control the content of the cvjs_customCommand_XX methods.

Last updated on 6 Sep 2022
Published on 22 Mar 2020