Initialize and Load Drawing
Initialization
Use the initialization method that corresponds to the attribute controls you want to run CADViewer with. The minimum initialization must reference a div element <div> with a defined id, in the samples we use ‘floorPlan’.
The initialization of CADViewer shoud be inside a $(document).ready(function(){}) and there should additionally be implemented a $(document).resize(function(){}) to resize CADViewer whenever the browser resizes.
Method Calls
Use the intialization calls to the CADViewer API methods in the following order:
The above initalization portion of the code will be modified depending on the Handlers used in implementaiton, and the declaration part will change as more controls for File Modals, Redlines, Image Objects, Interactive Highlight Modal controls, etc. are added.
Note: Some method calls are optional and some are mandatory. Click on the method to open the API documentation. Initialize the methods in this order.
-
cvjs_CADViewerPro(true) - optional
-
cvjs_debugMode(true) -optional
-
cvjs_setServerLocationUR() - required
-
cvjs_emailSettings_PDF_publish() - optional
-
cvjs_loadCADViewerLanguage() - required
-
cvjs_setTopMenuXML() - optional
-
cvjs_InitCADViewer_app() - required (3rd parameter imagePath can be left empty)
-
cvjs_setLicenseKeyPath() - optional
-
cvjs_setLicenseKeyDirect() - optional
-
cvjs_allowFileLoadToServer() - optional
-
cvjs_setServerHandlersPath() - required, initialization differs depending on Handlers
-
cvjs_conversion_addAXconversionParameter() - optional
-
cvjs_LoadDrawing() - required
-
cvjs_resizeWindow_position() - required
-
cvjs_resizeWindow_fixedSize() - required - use either cvjs_resizeWindow_position() or cvjs_resizeWindow_fixedSize()
Note: The required settings of the location and name of the Handler controlling the conversion of CAD files has been included here for illustration purposes. In all samples, these initializations has been moved out to the Java Script documents XXXHandlerSettings.js defined for each Handlers back-end technology.
-
cvjs_setRestApiControllerLocation() - required
-
cvjs_setRestApiController() - required
-
cvjs_setConverter() - required