CADViewer Callback Methods
CADViewer has implemented a set of call-back methods when an action has been performed on the canvas or a file has loaded:
General Functional Callback Methods
-
cvjs_OnLoadEnd() - callback when a drawing has been loaded
-
cvjs_OnLoadEndRedlines() - callback when a redline has been loaded
-
cvjs_graphicalObjectOnChange() - callback for any interaction on the canvas. NOTE: used for Redlines, StickyNotes and SpaceObjects
-
cvjs_change_space() - callback for change of focus on Space Object
-
cvjs_graphicalObjectCreated() - callback for space Object created, use vjs_graphicalObjectOnChange in general case
-
cvjs_ObjectSelected() - callback for space Object selected, use vjs_graphicalObjectOnChange in general case
These Java Script callback methods must be implemented as placeholders.
Canvas Interaction Callback Methods
CADViewer provides the ability to add click-handlers to graphical objects in display CAD file. These objects are defined by the Entity Handle in the originating AutoCAD or MicroStation file being displayed by CADViewer. The *Entity Handles are parsed by adding the following conversion control parameter -hlall , see more in the section Conversion Control Parameters and AutoXchange 2023 parameter interface.
cadviewer.cvjs_conversion_addAXconversionParameter("HLALL", "");
These Java Script callback methods should be implemented as placeholders. In the npm based CADViewer GitHub repository samples, these are all implemented as defined callback methods.
- cvjs_dblclick() - CADViewer canvas handler
- cvjs_mouseout() - CADViewer canvas handler
- cvjs_mousedown() - CADViewer canvas handler
- cvjs_click() - CADViewer canvas handler
- cvjs_mouseover() - CADViewer canvas handler
- cvjs_mouseleave() - CADViewer canvas handler
- cvjs_mousenter() - CADViewer canvas handler