Visual Query Technical Documentation, Installation Guide and Reference Samples Library

Visual Query Callback Methods

CADViewer Visual Query in it’s implementation uses the CADViewer call-back methods when an action has been performed on the canvas or a file has loaded. These methods are implemented in the main /scr/components/CADViewer/CADViewer.js class in Visual Query.

When exporting the callback over helper components, for example in CADViewer.js implement:

import * as RedlineAreaMethods from "../CADViewerHelperMethods/components/RedlineAreaMethods.component.tsx";	

// and in the general callback, call the impementation in the helper component
const cvjs_graphicalObjectOnChange = useCallback((type, graphicalObject, spaceID, evt) => {
    RedlineAreaMethods.graphicalObjectOnChange(type, graphicalObject, spaceID, evt);

and in the helper component RedlineAreaMethods.tsx, implement:

// internalcallback01 is the method that implements the callback when it's been fired off on the main canvas
export function graphicalObjectOnChange(type: any, graphicalObject: any, spaceID: any, evt: any) {
    internalcallback01(type, graphicalObject, spaceID, evt)
}

All links below links to the general CADViewer callback documentation.

General Functional Callback Methods

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.

Last updated on 10 Aug 2022
Published on 9 Apr 2020