CADViewer - JavaScript API

View all Icon Commands with corresponding API Methods.

Search all API Methods





Methods

cvjs_allLayersInDrawingOn(f_div)

Sets all layers in drawing On

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div String

div of the CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_AllLayersOff()

Turn all Layers and Space Object layers and redlines off - Object Spaces, Sticky Notes and Redlines are differentiated.

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_AllLayersOn()

Turn all Layers and Space Object layers and redlines on - Object Spaces, Sticky Notes and Redlines are differentiated.

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_batchConvertDrawingsToPDF_CustomReport(string, dFilesArr, pageOrint, pageSize, pageRes, string, Object)

Loads a set of drawings, apply page size, page orientation and resolution to each page/drawing. Produce a multi-page PDF out of the set of drawing.

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
string

floorPlan - Name of the floorplan div for batch processing

dFilesArr Array.<string>

String array with name and location of drawings

pageOrint Array.<string>

String array with orientation of drawings: landscape/portrait

pageSize Array.<string>

String array with papersizes of drawings

pageRes Array.<string>

Array with page resolutions

string

batch_Ctrl - Name of the php document that creates the report when the graphics is created

Object

callbackMethod - callBackMethod to decorate each drawing before publishing

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_calibrateMeasurement(f_div)

Calibrate measurement

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_changeRedlineObjectColor(redlineId, hexColor)

Change the Redline Object color based on a Redline ID

Parameters:
Name Type Description
redlineId string

redline ID

hexColor string

color in HEX format with #

cvjs_changeRedlineObjectLineWeight(redlineId, strokeWidth)

Change the Redline Object line weight

Parameters:
Name Type Description
redlineId string

Redline Object ID

strokeWidth float

stroke width

cvjs_compareDrawings_externalModal(methodflag, method, servertype)

Setting of external modal for compare drawings file load

Parameters:
Name Type Description
methodflag boolean

true to activate false to deactivate

method object

object to pass over the method to be called, the method will be called with filename

servertype string

type of server installation, can be "NextCloud", "Standard", etc.

cvjs_Conversion_forPrint(f_div, originatingContent, originatingUsername, originatingPassword, fileFormat)

Conversion for Print , either SVG or PDF with JSON handling.

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of floorplan div

originatingContent string

base file name

originatingUsername string

username or ""

originatingPassword string

password or ""

fileFormat string

"pdf" or "svg"

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_currentHost() → {string}

Finds the current host of the library

CADViewer Internal Command Groups: All.

See:
Returns:

host - current hostlocation

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_currentURL() → {string}

Finds the current url of the library

CADViewer Internal Command Groups: All.

See:
Returns:

url - current location

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_DisablePrintIcon(f_div)

Disables print Icon

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div String

name of Element in which CADViewer is running

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_displayInformationModal(f_div, text, modalHeight, modal_left,, modal_top,)

Activates and displays the information modal with text

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

text String

string to display

modalHeight int

of modal, omit if using standard values

modal_left, int

position of modal

modal_top, int

position of modal

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_EnablePrintIcon(f_div)

Enables print Icon

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div String

name of Element in which CADViewer is running

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_encodeURIcallToserver(flag)

Sets flag to control if call to server php for conversion shall be URI encoded or not. Default is true.

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
flag boolean

default is true. Set to true to custom implement this feature

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_fileLoadFromSharePointServer(mode)

Sets file loading so that it done from a SharePoint Server

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

true to load files from sharepoint server, file names are then loaded through internal sharepoint REST calls, false is default standard server load of draiwngs

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_fileLoadModal_externalModal(methodflag, method, servertype)

Setting of external modal instead of standard file load modal of drawings

Parameters:
Name Type Description
methodflag boolean

true to activate false to deactivate

method object

object to pass over the method to be called, the method will be called with filename

servertype string

type of server installation, can be "NextCloud", "Standard", etc.

cvjs_get_dwg_scaled_value(n, page) → {float}

Returns the DWG/Global coordinates scaled value

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
n float

svg coordinate value

page int

page number in the drawing set

See:
Returns:

scaled_value - value in dwg space

Type
float
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_get_dwg_x_coord(x, page) → {float}

Returns the DWG/Global coordinate based on SVG value

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
x float

svg coordinate value

page int

page number in the drawing set

See:
Returns:

scaled_value - value in dwg space

Type
float
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_get_dwg_y_coord(y, page) → {float}

Returns the DWG/Global coordinate based on SVG value

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
y float

svg coordinate value

page int

page number in the drawing set

See:
Returns:

scaled_value - value in dwg space

Type
float
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getActivePaletteColor(colornumber)

Get the color of a given palette number in the drawing. NOTE, first palette color has index 0.

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
colornumber int

palette number

Returns:
  • hex code of color

cvjs_getActivePaletteColorList()

Returns a list of all active palette colors in drawing. NOTE, first palette color has index 0. CADViewer Internal Command Groups: All.

Returns:
  • list of color palette numbers

cvjs_getAutoCADColor() → {string|int}

Returns the HEX color as AutoCAD Color table

CADViewer Internal Command Groups: All.

See:
Returns:
  • hexNumber - hex value of color.

    Type
    string
  • colorNumber - number of color

    Type
    int
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getCurrentMultiPage_FileName() → {string}

Returns the current fileName from the MultiPages list

CADViewer Internal Command Groups: All.

See:
Returns:

url - current location

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getGlobal_X_fromSVG(x) → {float}

Returns the DWG/Global coordinate based on SVG value from current page

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
x float

svg coordinate value

See:
Returns:

scaled_value - value in dwg space

Type
float
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getGlobal_Y_fromSVG(y) → {float}

Returns the DWG/Global coordinate based on SVG value from current page

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
y float

svg coordinate value

See:
Returns:

scaled_value - value in dwg space

Type
float
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getMultiSelect() → {boolean}

Controls the multiselect variable status

CADViewer Internal Command Groups: All.

See:
Returns:

multiSelect - value of multiselect flag

Type
boolean
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getRedlineStickyNoteBusinessContent() → {Object}

Retrieve all Redline and StickyNote non-graphical API content, ID, User, date, text, etc.

CADViewer Internal Command Groups: All.

See:
Returns:

custom_content - JSON array with all non-graphical API content, ID, User, date, text, etc.

Type
Object
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getSVG_X_fromGlobal(x) → {float}

Returns the svg X coordinate based on DWG/Global coordinate

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
x float

global coordinate value

See:
Returns:

scaled_value - value in dwg space

Type
float
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getSVG_Y_fromGlobal(y) → {float}

Returns the DWG/Global coordinate based on SVG value from current page

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
y float

svg coordinate value

See:
Returns:

scaled_value - value in dwg space

Type
float
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_hideInformationModal(f_div)

Hides the information modal with text

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_interactiveLayerOff(f_div)

Turn a single layer on interactively

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

div of the CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_isUnifiedDrawing() → {boolean}

Checks if a drawing is unified

CADViewer Internal Command Groups: All.

See:
Returns:

multiSelect - value of multiselect flag

Type
boolean
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_LayerList(f_div)

Open the Layer List menu for layer handling

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_layerNamefromObjectID(myObjectId) → {string}

Return orginal file layer name based on SVG object ID

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
myObjectId string

id of the element in the SVG file

See:
Returns:

layer - layer name

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_Measurement(f_div)

Activates the measurement modal

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div String

div of the CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_multipagePDFtoSVG_PhpLoad(mode)

Load multipage PDF converter to SVG through php

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

loading converted SVG from PDF via php, default is false and direct load of svg

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_overwritePDFOutputParameter(flag, param, value)

When printing to PDF, overwrite the pre-set parameters or navigated layout with this parameter

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
flag boolean

true to overwrite, false to reset to original

param string

conversion parameter

value string

conversion value

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_PageChangeList(f_div)

Open the Page Change menu to select a page in a multipage drawing

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_Print(f_div)

Funtion to open print model, interactively set paper size, resolution and orientation and then print API method linked to icon interface

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_printCanvasPaperSize()

Function to print to papersize, based on settings provided in cvjs_setPrintOrientation(), cvjs_setPrintResolutionDpi() and cvjs_setPrintPaperSize()

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_printToPdf_windowRelativeSize(scale)

Sets the size of the print window as a relation of the screen between 0 and 1

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
scale float

the size of the print window as a relation of the screen between 0 and 1, default is 0.4

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_RedlineUserList(f_div)

Open the Redline User menu to select/deselect users redlines

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_removeHandleFunc_Generic()

Reset the current redline operation

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_removeHandleFunc_Standard()

Standard call to remove handleGroup

cvjs_removePrintObjectAfterPrint(flag)

Set flag to clean temporary print object after use. Requires the cvjs_setServerHandlersPath() general php folder location to be defined with an absolute path

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
flag boolean

true for remove, false to leave as is

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_restAPI_getSVGContentData(remainOnServer) → {string}

Returns the end-point to get SVG object loaded from Server, if remainOnServer has been set to true on CADViewer Server.

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
remainOnServer boolean

flag remove after use, default is false = remove,

See:
Returns:

SVGobject - Url to pull SVG from server

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_returnNonPreprocessedSVG() → {string}

Returns the parsed SVG object loaded before pre-processing.

CADViewer Internal Command Groups: All.

See:
Returns:

SVGobject - SVG loaded into CADViewer

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_returnRedlineObjectID(RedlineID)

Returns a JSON structure with the Redline

Parameters:
Name Type Description
RedlineID *

Redline Object ID , RED_ node or it's ID, whichever comes first

Returns:
  • JSON object with the Redline structure

cvjs_saveScreenAsImage(serverPath, image_fileName)

Save screen image to server as well as list of stickyNote content and information On the server two thumbnails are created

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
serverPath string

path on Server to save image content

image_fileName string

name of image file on server.

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_saveScreenAsImage_makeTumbnails(serverPath, image_fileName, sizeThumb1, thumb1_file, sizeThumb2, thumb2_file)

Save screen image to server On the server two thumbnails are created

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
serverPath string

path on Server to save image content and create thumbnails

image_fileName string

name of image file on server. The file with sticky note content will be named fileName.txt

sizeThumb1 int

size in pixels of thumbnail one

thumb1_file string

filename of thumbnail one on server

sizeThumb2 int

size in pixels of thumbnail two

thumb2_file string

filename of thumbnail two on server

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_saveScreenAsImage_stickyNoteInfo_makeTumbnails(serverPath, image_fileName, size1, t1, size2, t2)

Save screen image to server as well as list of stickyNote content and information On the server two thumbnails are created

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
serverPath string

path on Server to save image content and create thumbnails

image_fileName string

name of image file on server. The file with sticky note content will be named fileName.txt

size1 int

size in pixels of thumbnail one

t1 string

filename of thumbnail one on server

size2 int

size in pixels of thumbnail two

t2 string

filename of thumbnail two on server

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_saveScreenAsPDF(pageOrientation, pageSize, pageResolution)

Captures the screen image and creates a single page PDF

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
pageOrientation string

Orientation of drawings: landscape/portrait

pageSize string

Papersize of drawing

pageResolution string

Page resolution in dpi, default is 300

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_saveScreenAsPDF_serverSettings(methodflag, method, path, stype, dflag, eflag, sflag)

Parameters:
Name Type Description
methodflag boolean

flag set to use method or path, true method false path

method object

object to pass over the method to be called, the method will be called with filename

path string

path on server if used

stype string

type of server installation, can be "NextCloud", "Standard", etc.

dflag boolean

display download/ button

eflag boolean

display e-mail button

sflag boolean

display server upload button

cvjs_searchTextNext(searchString, zoomFactor)

Search the drawing for a text string with a given zoom factor. Highlight result in red. Continue search on next object in Drawing.

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
searchString string

the text search string

zoomFactor float

the zoomfactor in percent. 100 is default

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_selectPaperSize(paperSize)

Set selected papersize in Print Modal

Parameters:
Name Type Description
paperSize string

cvjs_setActiveFloorplan(f_div)

Set the active footer div, in case there are multiple floorplans in the viewer

Parameters:
Name Type Description
f_div string

, name of the floorplan div, if name not in current list no action performed

cvjs_setActiveFloorplanIndex(index)

Set the active footer div number, in case there are multiple floorplans in the viewer

Parameters:
Name Type Description
index int

, index runs from 0 up to the last floorplan, if index not in current band no action performed

cvjs_setActivePaletteColor(colornumber, hex)

Set a given palette color number with a hex color. NOTE, first palette color has index 0. CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
colornumber *

color palette number

hex *

new color, given in hex number.

cvjs_setAllServerPaths_and_Handlers(BackEndUrl, Url, ServerLocation, handlerType, frontEndType, f_div, ctrlPath)

Set the Handlers for server communication - user controlled combination of front-end and back-end Pass over the current settings for ServerLocationbackendUrl, Url and ServerLocation (or set to load location via script)

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
BackEndUrl string

server backend Url of back-end scripts interface

Url string

server location of html Element on which CADViewer is located

ServerLocation string

server location of html Element on which CADViewer is located

handlerType String

the following settings are implemented: 'DotNET', 'PHP', 'Servlets', 'NodeJS', 'DotNETCore'

frontEndType String

the following settings are implemented: 'ReactJS', 'Angular', 'JavaScript', 'VueJS'

f_div String

the floorplan div in which CADViewer is running

ctrlPath String

optional, set the controller Path, used with dotNetCore

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setAngular(mode)

Set Angular Mode

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

set flag for Angular mode. Default is false

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setBackgroundColor(f_div)

Calls modal for setting background color

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setBackgroundColorHex(hex, f_div)

Set the background color of CADViewer canvas, using HEX

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
hex string

of background, hex string, can be with or without #

f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setBearerToken(token)

Set a bearer token for all REST API calls

Parameters:
Name Type Description
token string

, if null or "" then no token is set and header is removed

cvjs_setCustomMergedEmailHandler(handlerName)

Sets the name of server side handler to custom control merged content sent as email

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handlerName string

name of the controller/handler document

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setCustomPDFprintController(handlerName)

Sets the name of server side controller to custom control print as PDF inside print modal

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handlerName string

name of the controller/handler document

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setCustomPDFprintControllerFlag(customPrintAsPDF)

Sets flag to control if Print to PDF inside print modal shall be handled by custom controller. The name of controller is defined in: cvjs_setCustomPDFprintController()

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
customPrintAsPDF boolean

default is false. Set to true to custom implement this feature

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setDefaultJSPath(path)

Set the script paths to load default drawings for encapsulate png rendering, typically ../javascripts

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
path string

to default script-file folder

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setDisableClickDrag(flag)

Control if interactive drag inside a space, shall be disabled or not

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
flag boolean

false for interactive drag, true to disable, false is default.

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setGetFileController(handlerName)

Sets the name of server side controller to load drawings after conversion

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handlerName string

name of the controller/handler document

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setHandleObjectProcessing(hlallProcessing)

Set the HLALL processing at load - handle processing is also used internally for snap in measurement

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
hlallProcessing boolean

flag to parse handles at load, default is false

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setHandlers_FrontEnd(handlerType, frontEndType, f_div, controllerPath)

Set the Handlers for server communication - user controlled combination of front-end and back-end

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handlerType String

the following settings are implemented: 'DotNET', 'PHP', 'Servlets', 'NodeJS', 'DotNETCore'

frontEndType String

the following settings are implemented: 'ReactJS', 'Angular', 'JavaScript', 'VueJS'

f_div String

the floorplan div in which CADViewer is running

controllerPath String

optional, set the controllerPath, used with dotNetCore

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setHandlerSettings(handlerType, f_div, controllerPath)

Set the Handlers for server communication - assumptions of back-end + front end assumed

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handlerType String

the following settings are implemented: 'ReactJS', 'Angular', 'dotNet', 'dotNetCore' 'PHP', 'Servlets', NodeJS'

f_div String

the floorplan div in which CADViewer is running

controllerPath String

the controller path, if any, primarily used for dotNetCore

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setInformationModalType(modal)

Activates and displays the information modal with text

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
modal int

type, 1 for bootstrap modal, 2 for standard floating modal, default is bootstrap modal

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setInitMasterBackgroundMode(mode)

Sets the status of the drawing cvjs_masterbackground[cvjs_active_floorplan_div_nr]. If set to true, refreshed on reload, if false multiple drawings can be merged into canvas

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

true for standard load, false for overlay of drawings on concequitive loads.

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setInteractiveZoomWidthAdjustment(flag)

Control if interactive zoom adjusts lineweights dynamically

CADViewer Internal Command Groups: zoom.

Parameters:
Name Type Description
flag boolean

flag for integrated zoom adjustment of lines, default is true

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setISOtimeStamp(filename, isostamp)

Sets the ISO time stamp of the drawing to be loaded for server side cache, the default is "none"

Parameters:
Name Type Description
filename String

same FileName as to be used with cvjs_LoadDrawing()

isostamp String

the time stamp of the file using ISO notation.

cvjs_setISOtimeStampCompare(filename, isostamp)

Sets the ISO time stamp of the compare drawing to be loaded for server side cache, the default is "none"

Parameters:
Name Type Description
filename String

same FileName as to be used with cvjs_LoadDrawing()

isostamp String

the time stamp of the file using ISO notation.

cvjs_setJSFileOldType(oldtype)

Sets the loading of filetypes to be the old CADViewer type, in which each file consists of four separate files

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
oldtype boolean

true for oldtype, false for standard new type. Default is false.

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setMultiSelect(multiSelect)

Controls the multiselect variable status

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
multiSelect boolean

multiselect flag, default is false

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setNodeJSserver(mode)

Set NodeJS Server flag

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

set flag for nodejs handling. NodeJS server behaves differently for print, default false

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setPhpPath(path)

Sets the location to the php folder

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
path string

current location of php scripts, typically ../php/

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setPhpUploadPath(Url)

Sets the location to the php upload folder, this can be on a different domain

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
Url string

location of upload_2.php document

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setPrintModal_printGreyScaleflag(printGreyScaleflag)

Controls if GreyScale feature is included in print Modal

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
printGreyScaleflag boolean

true is default, set to false to hide printGreyScaleflag in Print Modal

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setPrintModal_PrintPDF(printPDFflag, printAsPDF)

Controls if Print to PDF feature is included in print Modal

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
printPDFflag boolean

true is default, set to false to hide PrintAsPDF in Print Modal

printAsPDF boolean

false is default, true will set pdf print flag even if PrintAsPDF checkbox is invisible

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setPrintModal_PrintToScale(printToScaleflag)

Controls if Print to Scale feature is included in print Modal

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
printToScaleflag boolean

true is default, set to false to hide PrintToScale in Print Modal

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setPrintObjectPath(path)

Sets the location to the print objects

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
path string

location of print object relative to Controller, can also use absolute paths standard is "./temp_print/"

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setPrintObjectPathAbsolute(pathUrl, absolutePathServer)

Sets the location to the print objects

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
pathUrl string

location of print objects, web path

absolutePathServer string

location of print objects, server side absolute path

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setPrintOrientation(orientation)

Sets the print orientation

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
orientation string

print orientation, portrait or landscape

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setPrintPaperSize(papersize)

Sets the paper size of print output

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
papersize string

String containg paper size, allowed settings are: A4, A3, A2, US LETTER, ANSI A, ANSI B, ANSI C

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setPrintResolutionDpi(dpi)

Sets the print resolution

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
dpi int

print resolution in dpi, minumum is 75dpi, standard is 300

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setQtipLocation(qtip_location_my, qtip_location_at)

Sets the z-index of qtip modals

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
qtip_location_my int

insert location if the qtip itself

qtip_location_at int

insert location relative to the highlight object

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.   

                          

cvjs_setQtipZindex(zindex)

Sets the z-index of qtip modals

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
zindex int

zindex of ztip

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setReturnPathController(returnPathController)

Sets the server location controller

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
returnPathController String

controller name

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setReturnPDFparamsController(handlerName)

Sets the name of server side controller to return path structure for PDF conversion

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handlerName string

name of the controller/handler document

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerAppendFileHandler(handlerName)

Sets the name of server side append-file controller document

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handlerName string

name of the controller/handler document

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerAppendFileHandlerPrint(handlerName)

Sets the name of server side append-file controller document for print

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handlerName string

name of the controller/handler document

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerCopyFileHandler(handlerName)

Sets the name of server side copy-file controller document

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handlerName string

name of the controller/handler document

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerCreateThumb_StickyNote_Controller(controller)

Sets the server controller to save screen as bitmap and create thumbnails

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
controller String

the name of the controller

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerDeleteFileHandler(handlerName)

Sets the name of server side delete-file controller document

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handlerName string

name of the controller/handler document

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerDeleteFileHandlerPrint(handlerName)

Sets the name of server side delete-file controller document for print

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handlerName string

name of the controller/handler document

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerGetQRCodeController(serverGetQRCodeController)

Sets the insertion location of QR Codes

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
serverGetQRCodeController String

controller name

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerHandlersPath(path)

Sets the location of the server side handers for load, save, append and print controls

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
path string

location of print handlers, in the standard case this in the "/php/" folder with redline and file controllers

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerListDirectoryHandler(handlerName)

Sets the name of server side directory list controller document

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handlerName string

name of the controller/handler document

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerLoadHandler(handlerName)

Sets the name of server side load-file controller document for file list load

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handlerName string

name of the controller/handler document

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerLoadHandlerRedlines(handlerName)

Sets the name of server side load-file controller document for redline load

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handlerName string

name of the controller/handler document

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerMergeDWGHandler(handlerName)

Sets the name of server side merge DWG controller document

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handlerName string

name of the controller/handler document

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerPDFConverterController(handlerName)

Sets the name of server side controller to control PDF conversion

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handlerName string

name of the controller/handler document

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerRedlinesListDirectoryHandler(handlerName)

Sets the name of server side directory redlines list controller document

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handlerName string

name of the controller/handler document

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerSaveFileHandler(handlerName)

Sets the name of server side save-file controller document

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handlerName string

name of the controller/handler document

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerSaveFileHandlerPrint(handlerName)

Sets the name of server side save-file controller document for print

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handlerName string

name of the controller/handler document

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerSaveHandlerRedlines(handlerName)

Sets the name of server side save-file controller document for redline save

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handlerName string

name of the controller/handler document

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerSavePrintModeController(mode)

Sets the server print mode controller. This variable is used to control what happens after a screenshot is sent to the server

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode int

the mode in which to control encapsulations of screenshots images sent down to server mode = 0: Standard print mode in which a screenshot gets encapsulated into an html document that is opened through a pop-up for printing mode = 1: The screenshot is saved to the server as part of stickyNote save, and thumbnails of the image is generated, see method: cvjs_saveScreenAsImage_stickyNoteInfo_makeTumbnails() mode = 2: The screenshot is saved to the server as part of a multidocument batch print pdf creation, see method: cvjs_batchConvertDrawingsToPDF()

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerSavePrintModeHandler(mode)

Sets the server print mode controller. This variable is used to control what happens after a screenshot is sent to the server

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode int

the mode in which to control encapsulations of screenshots images sent down to server mode = 0: Standard print mode in which a screenshot gets encapsulated into an html document that is opened through a pop-up for printing mode = 1: The screenshot is saved to the server as part of stickyNote save, and thumbnails of the image is generated, see method: cvjs_saveScreenAsImage_stickyNoteInfo_makeTumbnails() mode = 2: The screenshot is saved to the server as part of a multidocument batch print pdf creation, see method: cvjs_batchConvertDrawingsToPDF()

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerScreenToPDFController(controller)

Sets the server ScreenToPDF PHP controller document

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
controller String

The location of this document is in: cvjs_phpPath if php, else it will use handler folder.

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerScreenToPDFHandler(controller)

Sets the server ScreenToPDF PHP controller document

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
controller String

The location of this document is in: cvjs_phpPath if php, else it will use handler folder.

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setSpaceObjectProcessing(spaceProcessing)

Enable or Disable Space Object processing at load

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
spaceProcessing boolean

flag to parse spaces at load, default is true

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setUnitForCalibrate(unit)

Set the initial unit in Calibrate command

Parameters:
Name Type Description
unit string

unit mm,cm,mm, km, inch, feet

cvjs_setUploadController(handlerName)

Sets the name of server side upload controller document

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handlerName string

name of the controller/handler document

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setUploadControllerPath(Url)

Sets the location to the upload controller location, this can be on a different domain

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
Url string

location of upload controller

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setUploadHandler(handlerName)

Sets the name of server side upload controller document

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handlerName string

name of the controller/handler document

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setWatermarks(textline1, textline2, hexcolor, sendtoback)

Sets 9 individual watermarks, each rotated and with color hexcolor, can be on top or sent to back of drawing

Parameters:
Name Type Description
textline1 string
textline2 string
hexcolor string
sendtoback boolean

cvjs_startSearchText()

Calls the interactive modal for text search

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_suppressServerErrorMessages(flag)

Suppress the server side error messages,

Parameters:
Name Type Description
flag boolean

default is false, if true, the server side error messages are suppressed

cvjs_swapLayersInDrawing(f_div)

Swap drawing layers On/Off

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div String

div of the CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_unifiedDrawing_firstPage()

Identify first page in Unified Drawing

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_unifiedDrawing_initializePage(pagenr)

intialize a page after a pagechange on a Unified drawing

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
pagenr int

page number

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_unifiedDrawing_pageChange(page)

Change pace in drawing processed with AutoXchange -unified parameter

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
page int

page number

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_unifiedDrawing_parseMetadataSection(pagenr)

parse the metadata section of a unified drawing

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
pagenr int

page number

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_version() → {string}

Display the current version number of the CADViewer toolkit and viewer

CADViewer Internal Command Groups: All.

See:
Returns:

version - current version number

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_activateFixedZoomWidthAdjustment(flag)

Set if Fixed Weight objects shall be interactively modified by zoom operations

Parameters:
Name Type Description
flag boolean

true if active, false if not, default is true

cvjs_addSVGClickHandler_onLoad(mode)

Set the clickhandler mode for SVG on load. The default is false
All SVG objects with an 'id' implemented will be associated with a clickhandler
The method will call a number of user implemented call-back methods:
cvjs_SVGfileObjectClicked(id, x, y) : callback for click on an object, this method is user implemented
cvjs_SVGfileObjectMouseEnter(id, x, y) : callback for mouse entering an object, this method is user implemented
cvjs_SVGfileObjectMouseLeave(id, x, y) : callback for mouse leaving an object, this method is user implemented
cvjs_SVGfileObjectMouseMove(id, x, y) : callback for mouse move on an object, this method is user implemented

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

true: click handlers are added to objects on load, false: no handers added on load

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_adjustMinimumLineThickness(precentage)

Adjust minimum line thickness

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
precentage int

In percentage, set the factor to adjust the minumum line thickness, a value over 100 makes lines thicker, a value below 100 makes lines thinner

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_adjustMinimumLineThickness_Value(value)

Adjust minimum line thickness for all content

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
value float

Set the minumum line thickness

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_allLayoutViewportScales()

Calculate arrays with viewport scale factor based on current layout and active view

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_allowFileLoadToServer(mode)

Enables file load through the icon interface, or allows it only through the encapsulating application

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

true for file load through File Manager, default is false

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_bringForward(f_div)

Bring a Space Object forward, Space Object is selected with SHIFT+Click

Parameters:
Name Type Description
f_div string

name of floorplan div in which CADViewer is running

cvjs_bringToFront(f_div)

Bring a Space Object to front, Space Object is selected with SHIFT+Click

Parameters:
Name Type Description
f_div string

name of floorplan div in which CADViewer is running

cvjs_buildMultiPageSVG(directory, url_directory)

Build an internal navigational structure over a folder with SVG files named sequentially xx_1.svg, xx_2.svg....

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
directory string

server side name of the folder in which the svg files are placed. The folder should only contain the svg files to navigate over

url_directory string

url of the folder in which the svg files are placed.

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_changePageByNumber(f_div, newpagenumber) → {boolean}

Change page on the current drawing based on page number

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of Element on which CADViewer is located

newpagenumber int

a number between 1 and the total pages in the drawing

See:
Returns:

status - false if newpagenumber outside of range, true if page change

Type
boolean
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_clearCurrentRedline(f_div)

Clear all redlines currently visible

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div String

div of the CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_ClearDrawing(f_div)

Clears the drawing space of CADViewer

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

the div canvas object to which CADViewer is allocated

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_conversion_addAXconversionParameter(name, value)

Add an AutoXchange conversion control parameter for server based conversion

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
name string

conversion parameter name

value string

conversion parameter value, if no value set ""

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_conversion_addAXconversionParameters(axparameters)

Adds all AutoXchange conversion control parameter for server based conversion through a JSON array

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
axparameters Object

json array with AX control parameters

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_conversion_clearAXconversionParameters()

Clears the custom AutoXchange conversion control parameter for server based conversion

CADViewer Internal Command Groups: All.

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_conversion_getContentResponse()

Get the current type of content response

CADViewer Internal Command Groups: All.

See:
Returns:

string - Returns type of content response - "file | embedded | stream"

Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_conversion_setContentFormat(contentFormat)

Sets control parameter for conversion

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
contentFormat string

"DWG | DXF| DWF | DGN - DGN currently not implemented",

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_conversion_setContentResponse(userLabel)

Sets control parameter for conversion

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
userLabel string

" optional label returned in the response",,

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_conversion_setContentType(contentType)

Sets control parameter for conversion

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
contentType string

"file | embedded | stream"

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_conversion_setUserLabel(userLabel)

Sets control parameter for conversion

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
userLabel string

" optional label returned in the response",,

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_debugMode(debug)

Sets debug mode

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
debug boolean

true for debug traces, false otherwise

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_displayAllInterfaceControls(mode, f_div)

Removes all icon interface components for viewing, redlining, etc. so that developers can control their own interface

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

Set the modal interface, default is true

f_div String

the div running CADViewer

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_displayAllInterfaceControlsZoomDisk(f_div)

Show the zoom disk

CADViewer Internal Command Groups: zoom.

Parameters:
Name Type Description
f_div String

the div running CADViewer

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_DisplayCoordinatesMenu(f_div, displayFlag)

Display menu with transformed original DWG coordinates and display SVG coordinates

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div String

div in which CADViewer is implemented

displayFlag boolean

flag to display coordinates, default is false.

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_displayCustomSpaceObjectMenu(f_div, displayFlag)

Display menu with custom space icon objects for insertion

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div String

div in which CADViewer is implemented

displayFlag boolean

flag to display space object menu for insert, default is false.

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_displayTopMenuIconBar(display_status, f_div)

Controls top menu icon bar visibility

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
display_status boolean

default is true, use false to hide menu bar

f_div String

div in which CADViewer is implemented

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_displayTopNavigationBar(display_status, f_div)

Controls top menu navigation bar visibility

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
display_status boolean

default is true, use false to hide menu bar

f_div String

div in which CADViewer is implemented

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_displayZoomIconBar(display_status, f_div)

Controls Zoom menu visibility

CADViewer Internal Command Groups: zoom.

Parameters:
Name Type Description
display_status boolean

default is true, use false to hide menu bar

f_div String

div in which CADViewer is implemented

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_encapsulateUrl_callback(flag:)

Encapsulate Url in JavaScript callback method cvjs_Url_callback(). Developer gets control over all hyperlinks in drawing

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
flag: boolean

enable callback method false: disable callback method (link directly from drawing)

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_fileLoad_setContentFormat(fileFormat)

Sets fileformat for file-load

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
fileFormat string

"PNG, JPG, GIF", to set bitmap, "JS" for standard load

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_findAllTextInstances() → {object}

Extracts all text objects in a drawing and returns a JSON structure with all text, coordinates in both SVG and DWG coordinates and layer nanme and status

Returns:

returns a JSON structure with all text, coordinates in both SVG and DWG coordinates and layer nanme and status

[{"text":"One of simple 2","x_svg":"1211.25","y_svg":"538.09","x_dwg":"7.7615","y_dwg":"3.3928","layername":"0","layerstatus":"ON"}]

Type
object

cvjs_getCurrentPage() → {int}

Returns the current page number in the document loaded

CADViewer Internal Command Groups: All.

See:
Returns:

pageNumber

Type
int
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getLanguages() → {string}

Get the languages supported in CADViewer

CADViewer Internal Command Groups: All.

See:
Returns:

languages - string with available languages

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getServerBackEndUrl() → {string}

Get the current ServerBackEndUrl variable;

CADViewer Internal Command Groups: All.

See:
Returns:

ServerBackEndUrl - ServerBackEndUrl of current CADViewer settings

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getServerLocation() → {string}

Get the current ServerLocation variable;

CADViewer Internal Command Groups: All.

See:
Returns:

ServerLoction - server location of html Element on which CADViewer is located

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getServerURL() → {string}

Get the current ServerURL variable;

CADViewer Internal Command Groups: All.

See:
Returns:

ServerURL - server url of html Element on which CADViewer is located

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_Help(mouseclick)

Turns the interactive help menu system on/off

Parameters:
Name Type Description
mouseclick bool

cvjs_hideAllInterfaceControls(f_div)

Hide the page change modal

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div String

the div running CADViewer

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_Init_ConversionServer(rest_api_url, rest_api_php, username, password)

Set up CADViewer for the call to the server side custom implementation of the API controlling conversions of DWG,DXF, and DWF files through AutoXchange

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
rest_api_url string

url of conversion rest api on server

rest_api_php string

url of the PHP rest controller on server

username string

the username of the server, "" if no username

password string

the password of the server, "" if no username

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_InitCADViewer(f_div, image, javascripts_folder)

Initializes CADViewer, any of the methods cvjs_InitCADViewer_ must always be called setting up CADViewer

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

the SVG canvas object to which CADViewer is allocated

image string

folder - the path to the image location folder with icon settings, default is "+cvjs_imagesLocation+"

javascripts_folder string

the path to javascripts folder with icon settings, default is ../javscripts/

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_InitCADViewer_app(f_div, app_folder, imagePathDirect)

Initializes CADViewer, any of the methods cvjs_InitCADViewer_ must always be called setting up CADViewer

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

the SVG canvas object to which CADViewer is allocated

app_folder string

the path (relative or absolute) to the main application folder "app" , the default is the relative path "../app/". If installed via npm all resources are imported internally and this path is not used.

imagePathDirect string

direct paths to Images, typically "/assets/cadviewer/app/images/"

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_InitCADViewer_app_highLight(f_div, app_folder, spaceBaseAttr, spaceHighlAttr, spaceSelectAttr)

Initializes CADViewer, any of the methods cvjs_InitCADViewer_ must always be called setting up CADViewer

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

the SVG canvas object to which CADViewer is allocated

app_folder string

the path (relative or absolute) to the main application folder "app" , the default is the relative path "../app/", on Angular "/assets/cadviewer/app/. If installed via npm all resources are imported internally and this path is not used.

spaceBaseAttr object

javascript object containing fill, color and stroke properties for display of Space Object roompolygons

spaceHighlAttr object

javascript object containing fill, color and stroke properties for mouseover highlight of Space Object roompolygons

spaceSelectAttr object

javascript object containing fill, color and stroke properties for select highlight of Space Object roompolygons

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_InitCADViewer_app_highLight_popUp(f_div, app_folder, spaceBaseAttr, spaceHighlAttr, spaceSelectAttr, cvjsPopUpBody)

Initializes CADViewer, any of the methods cvjs_InitCADViewer_ must always be called setting up CADViewer

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

the SVG canvas object to which CADViewer is allocated

app_folder string

the path (relative or absolute) to the main application folder "app" , the default is the relative path "../app/", on Angular "/assets/cadviewer/app/. If installed via npm all resources are imported internally and this path is not used.

spaceBaseAttr object

javascript object containing fill, color and stroke properties for display of Space Object roompolygons

spaceHighlAttr object

javascript object containing fill, color and stroke properties for mouseover highlight of Space Object roompolygons

spaceSelectAttr object

javascript object containing fill, color and stroke properties for select highlight of Space Object roompolygons

cvjsPopUpBody object

html/css styled object containing the content of the modal when selecting Space Objects

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_InitCADViewer_highLight(f_div, spaceBaseAttr, spaceHighlAttr, spaceSelectAttr)

Initializes CADViewer, any of the methods cvjs_InitCADViewer_ must always be called setting up CADViewer

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

the SVG canvas object to which CADViewer is allocated

spaceBaseAttr object

javascript object containing fill, color and stroke properties for display of Space Object roompolygons

spaceHighlAttr object

javascript object containing fill, color and stroke properties for mouseover highlight of Space Object roompolygons

spaceSelectAttr object

javascript object containing fill, color and stroke properties for select highlight of Space Object roompolygons

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_InitCADViewer_highLight_popUp(f_div, spaceBaseAttr, spaceHighlAttr, spaceSelectAttr, cvjsPopUpBody)

Initializes CADViewer, any of the methods cvjs_InitCADViewer_ must always be called setting up CADViewer

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

the SVG canvas object to which CADViewer is allocated

spaceBaseAttr object

javascript object containing fill, color and stroke properties for display of Space Object roompolygons

spaceHighlAttr object

javascript object containing fill, color and stroke properties for mouseover highlight of Space Object roompolygons

spaceSelectAttr object

javascript object containing fill, color and stroke properties for select highlight of Space Object roompolygons

cvjsPopUpBody object

html/css styled object containing the content of the modal when selecting Space Objects

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_InitCADViewer_highLight_popUp_app(f_div, app, spaceBaseAttr, spaceHighlAttr, spaceSelectAttr, cvjsPopUpBody)

Initializes CADViewer, any of the methods cvjs_InitCADViewer_ must always be called setting up CADViewer

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

the SVG canvas object to which CADViewer is allocated

app string

folder - the path (relative or absolute) to the main application folder "app" , the default is the relative path "../app/"

spaceBaseAttr object

javascript object containing fill, color and stroke properties for display of Space Object roompolygons

spaceHighlAttr object

javascript object containing fill, color and stroke properties for mouseover highlight of Space Object roompolygons

spaceSelectAttr object

javascript object containing fill, color and stroke properties for select highlight of Space Object roompolygons

cvjsPopUpBody object

html/css styled object containing the content of the modal when selecting Space Objects

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_InitCADViewer_highLight_popUp_dual_Id(f_div, spaceBaseAttr, spaceHighlAttr, spaceSelectAttr, cvjsPopUpBody, cvjsPopUpBody2)

Initializes CADViewer, any of the methods cvjs_InitCADViewer_ must always be called setting up CADViewer

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

the SVG canvas object to which CADViewer is allocated

spaceBaseAttr object

javascript object containing fill, color and stroke properties for display of Space Object roompolygons

spaceHighlAttr object

javascript object containing fill, color and stroke properties for mouseover highlight of Space Object roompolygons

spaceSelectAttr object

javascript object containing fill, color and stroke properties for select highlight of Space Object roompolygons

cvjsPopUpBody object

html/css styled object containing the content of the modal when selecting Space Objects

cvjsPopUpBody2 object

second html/css styled object containing the content of the modal when selecting Space Objects, internally controlled based on type of Space Object

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_initZeroWidthHandling(f_div, scale_factor)

Init ZW class handling, automated Zoom and adjustment of zerowidth

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

scale_factor int

scale factor on zero width lines when zooming

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_interactiveSearchText(f_div)

Activates the interactive Text Modal

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of Element on which CADViewer is located

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_lastSavedView(f_div)

Zoom to Last Saved View if defined

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

cvjs_LayerOff(layer)

Turn single general layer on, either defined individually or as a Object Space layer or Text on a Space object - Sticky Notes and Redlines are differentiated.

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer string

name of layer to turn off

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_LayerOn(layer)

Turn single general layer on, either defined individually or as a Object Space layer or Text on a Space object - Sticky Notes and Redlines are differentiated.

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer string

name of layer to turn on

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_LayerOn_AllOff(layer)

Turn single Object Space layer on, turn all other layers off - Object Spaces, Sticky Notes and Redlines are differentiated.

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer string

name of layer to turn on

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_LayersOnOffPrepend(prependstring, onoff)

Turns a selection of prepended layers on

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
prependstring string

name of prepend string of layer

onoff string

"ON" or "OFF"

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_loadCADViewerLanguage(language, languagelocation)

Set the language in CADViewer by first loading the language file

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
language string

name of the language

languagelocation string

path and name of the language location, releative to install folder, if null or undefined, defaults to standard settings for the Handler

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_LoadDrawing(f_div, FileName)

Loads a drawing into CADViewer, this method can only be used after intialization of CADViewer through the cvjs_InitCADViewer_ methods

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

the SVG canvas object to which CADViewer is allocated

FileName string

the name and path to the location of the CADViewer drawing files to load in, the path is either absolute or relative to the document in which CADViewer is invoked

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_LoadDrawing_Conversion(f_div, originatingContent, FileNameNoExtension, originatingUsername, originatingPassword)

Loads a DWG drawing into CADViewer, this method can only be used after intialization of CADViewer through the cvjs_InitCADViewer_ methods The method connects to the TailorMade Restful API, alternative Open Source alternatives for conversion of DWG, DXF,DWF and DGN,PCF files

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

the SVG canvas object to which CADViewer is allocated

originatingContent string

the originating content, can be a http path to location, local server side path, stream link or 64 base encoded data

FileNameNoExtension string

file name of the drawing without extension - CADViewer will automatically generate naming

originatingUsername string

if the originating file is username/password protected , "" if no username

originatingPassword string

if the originating file is username/password protected , "" if no password

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_LoadDrawing_SVG(f_div, FileNamePath, FileName)

Loads a SVG drawing into CADViewer, this method can only be used after intialization of CADViewer through the cvjs_InitCADViewer_ methods

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

the SVG canvas object to which CADViewer is allocated

FileNamePath string

the filepath to the location of the SVG drawing files to load in, the path is either absolute or relative to the document in which CADViewer is invoked

FileName string

file name of the SVG drawing, optional as content will be loaded from FileNamePath, which may contain filename

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_LoadDrawing_SVG_string(f_div, basestring, FileName, base64)

Loads a SVG drawing into CADViewer as a string, this method can only be used after intialization of CADViewer through the cvjs_InitCADViewer_ methods

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

the SVG canvas object to which CADViewer is allocated

basestring string

the string containing the svg

FileName string

file name of the SVG drawing

base64 boolean

flag for base64 encoding

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_LoadDrawingInternal(f_div, FileNamePath, FileNameNoExtension, serverCallBack)

Loads a drawing into CADViewer, this method can only be used after intialization of CADViewer through the cvjs_InitCADViewer_ methods

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

the SVG canvas object to which CADViewer is allocated

FileNamePath string

the filepath to the location of the CADViewer drawing files to load in, the path is either absolute or relative to the document in which CADViewer is invoked

FileNameNoExtension string

file name of the drawing without extension (CADViewer will automatically generate naming and load in files associated with the file name)

serverCallBack boolean

set to false or undefined.

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_LoadTopIconMenuViewing(f_div)

Set the Community Menu if no XML file has been designated for menu configuration

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of Element on which CADViewer is located

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_LoadTopIconMenuXML_preconfigured(f_div)

Direct load of top Icon menu from a preconfigures XML configuration file, used to reload current icon menu based on browser zoom change

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div in which CADViewer is running

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_measurementLinesScaleFactor(factor)

Set a scale factor to arrow and area lines when measuring

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
factor string

scale factor to the standard line weight setting, default is 1.0

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_overwriteDefaultDeviceSettings(mode)

Overwrite default icon menu settings on devices

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

true: sets the icon menu on devices similar to desktop environment, false: do not change default. False is default

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_panDown()

Pans the current active drawing one step down

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_panLeft()

Pans the drawing one step to the left

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_panRight()

Pans the current active drawing one step to the right

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_panUp()

Pans the current active drawing one step up

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_redrawViewBox()

Redraws the current ViewBox, thereby refreshing the screen with same zoom settings

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_regenerateTopIconMenuXML(f_div)

After menu initialization and generation, this method call can be used to populate a new menu XML file

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of SVG element containing canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_resetZoomPan(f_div)

Zoom Extents on the drawing

CADViewer Internal Command Groups: zoom.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_resizeWindow_fixedSize(widthFloorplan, heightFloorplan, floorplan)

Resize CADViewer canvas after browser window changes, automatic adjustment based on canvas size and location

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
widthFloorplan float

width of containing element in pixels

heightFloorplan float

height of containing element in pixels

floorplan string

name of SVG element containing canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_resizeWindow_fixedSize_location(widthFloorplan, heightFloorplan, floorplan, xPos, yPos)

Resize CADViewer canvas after browser window changes, automatic adjustment based on canvas size and location

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
widthFloorplan float

width of containing element in pixels

heightFloorplan float

height of containing element in pixels

floorplan string

name of SVG element containing canvas

xPos int

x position of element

yPos int

y position of element

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_resizeWindow_position(floorplan)

Resize CADViewer canvas after browser window changes, automatic adjustment based on canvas size and location

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
floorplan string

name of SVG element containing canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_restApiController()

Returns the recommended conversion engine php controller for this library, use this to intialize the conversion server setup, this value gets overwritten using cvjs_Init_ConversionServer

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_restApiControllerLocation()

Returns the recommended conversion engine php controller location for this library, use this to intialize the conversion server setup, this value gets overwritten using cvjs_Init_ConversionServer

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_restApiConverter()

Returns the recommended converter for this library

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_restApiConverterVersion()

Returns the minimum recommended converter version number for this library

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_returnSpaceObjectSelected() → {string}

Returns the current object selected on active floorplan

CADViewer Internal Command Groups: All.

See:
Returns:

lastObj- current space object selected, -1 if no current selection

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_rotateAngle(angle, f_div)

Rotates an angle based from 0

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
angle float

rotation angle

f_div string

name of Element on which CADViewer is located

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_rotateBackward(f_div)

Rotates 90 degrees forward

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of Element on which CADViewer is located

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_rotateForward(f_div)

Rotates 90 degrees forward

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of Element on which CADViewer is located

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_searchAllTextInstances(searchString, exactMatch) → {string}

Performs a seach over all text object in drawing, and returns a JSON object with single or multiple entries of structure: [{"text":"This is a simple text","x":1055.24988876,"y":468.79}].

Parameters:
Name Type Description
searchString string

, the seach string

exactMatch bool

, true for exact match, false for partial string match

Returns:

JSON object of structure: [{"text":"This is a simple text","x":1055.24988876,"y":468.79}]

Type
string

cvjs_searchText(searchString, zoomFactor)

Text Search; finds a text string in the drawing, and zooms over the search result

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
searchString string

the text string to search after

zoomFactor int

zoom factor of the seach result in percentage of zoom extents

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_searchTextInstance(searchString, zoomFactor, textInstance) → {int}

Text Search; finds a text string in the drawing, and zooms over the search result

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
searchString string

the text string to search after

zoomFactor int

zoom factor of the seach result in percentage of zoom extents

textInstance int

if multiple entries of text object, load instance, the first instance is 1

See:
Returns:

1 if found, otherwise 0, 2 found on hidden layer

Type
int
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_sendBackward(f_div)

Send a Space Object backward, Space Object is selected with SHIFT+Click

Parameters:
Name Type Description
f_div string

name of floorplan div in which CADViewer is running

cvjs_sendToBack(f_div)

Send a Space Object to back, Space Object is selected with SHIFT+Click

Parameters:
Name Type Description
f_div string

name of floorplan div in which CADViewer is running

cvjs_setAllServerURLsLocation(ServerBackEndUrl, ServerUrl, ServerLocation)

Pass over the current settings for ServerLocationbackendUrl, ServerUrl and ServerLocation (or set to load location via script)

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
ServerBackEndUrl string

server backend Url of back-end scripts interface

ServerUrl string

server location of html Element on which CADViewer is located

ServerLocation string

server location of html Element on which CADViewer is located

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setCADViewerInterfaceVersion(version)

Sets the cadviewer interface version, version 7 and up is SVG based skin, version 6 is legacy bitmap fixed size icons

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
version int

version 7+ is new default, version 6 is legacy interface

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setCADViewerSkin(skin)

Sets the icon skin of CADViewer 7

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
skin String

div in which CADViewer is implemented

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setConverter(converter, version)

Set the AutoXchange converter name and version to be used for the Rest conversion call

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
converter string

converter name

version string

converter version

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setConverterCredentials(username, password)

Set the username and password to be used for the Rest conversion call

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
username string

username on the Rest server where AutoXchange is installed

password string

password on the Rest server where AutoXchange is installed

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setCustomCallbackMethodOnLoadEnd(callbackMethodOnLoadEnd, myOnLoadEndMethod)

Set custom call back method for OnLoadEnd when drawings are loaded.

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
callbackMethodOnLoadEnd boolean

false: default - no custom method , true: custom method defined.

myOnLoadEndMethod function

: method that is executed OnLoadEnd of drawing

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setCustomPdfFolder(customPdfFolderName, forcedUpdate)

Sets the path to folder with converted PDF pages. If the folder exists and contain the converted pdf, the converted content will be used for visualization

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
customPdfFolderName string

custom PDF path id, for permanent storage of converted PDF file

forcedUpdate boolean

if true, force the folder to be reconverted (if the originating pdf has been updated), false is default

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setCustomTopMenuXML(xml_config_file, f_div)

Loads in the top icon menu system from an XML file The XML file is in /cadviewer/app/js/menu_config/ The XML file allows custom settings of the number of menu pages, the start menu page and content of each page, based on the selection set of available API commands

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
xml_config_file String

XML top menu configuration file

f_div String

div in which CADViewer is implemented

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setDecimalsInMeasurementDisplay(decimals)

Sets the number of decimals in Measurement Display

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
decimals int

, number of decimals, default is 4.

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setFileLoadTimeOut(f_div, timeout)

Sets the time-out wait for file load

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

timeout int

The time-out in seconds

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setIconImageSize(f_div, pixelheight, pixelheight_large)

Sets the pixel height of icon menus

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div String

div in which CADViewer is implemented

pixelheight int

height of icon menu in pixels, default is 34.

pixelheight_large int

height of large icon menu in pixels, default is 34.

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setIconInterfaceControls_ClassicSkin(mode, f_div)

Set the classic icon desk, larger on desktop, smaller on devices

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

Set the modal interface, default is true

f_div String

the div running CADViewer

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setIconInterfaceControls_ClassicSkin_DevicesSizeOnly(mode, f_div)

Set the classic icon desk, device size on all platforms

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

Set the modal interface, default is true

f_div String

the div running CADViewer

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setIconInterfaceControls_DisableIcons(mode, f_div)

Removes the icon interface for viewing, redlining, etc. so that developers can control their own interface

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

Set the modal interface, default is true

f_div String

the div running CADViewer

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setIconInterfaceControls_MimimumDisk(mode, f_div)

Set minimum icon desk, same size on all platforms

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

Set the modal interface, default is true

f_div String

the div running CADViewer

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setIconInterfaceControls_PageModal(mode, disableNavButtons, f_div)

Disable/enable page change modal

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

Set the modal interface, default is true, false disables page change modal

disableNavButtons boolean

Disable page navigation icons in main menu disk. As a default when the page modal is disabled, extra navigation buttons are introduced in the icon interface. If always loading single page files, and no navigation is needed, set this to to true

f_div String

the div running CADViewer

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setIconInterfaceControls_PanZoomDisk(mode, f_div)

Set panzoom desk, same size on all platforms

CADViewer Internal Command Groups: zoom.

Parameters:
Name Type Description
mode boolean

Set the modal interface, default is true

f_div String

the div running CADViewer

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setJavaScriptsAbsoluteFolder(folder)

Set javascripts absolute folder url path. Used for print object to find scripts folder to access jquery and ajax

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
folder string

absolute jQuery javascripts folder url path

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setJavaScriptsJQ_AbsoluteFolder(folder)

Set javascripts absolute folder and jQuery url path. Used for print object to find scripts folder to access jquery and ajax

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
folder string

absolute jQuery javascripts folder url path and name

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setLanguage(Language)

Set the language in CADViewer

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
Language string

name of the language

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setLayerColor(layerName, layerHexColor)

Set a layer color

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layerName string

layer

layerHexColor string

hex color of layer

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setLeafletJS(mode)

Set the clickhandler mode for SVG on load. The default is false

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

set LefletJS mode , default is false

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setOriginatingFileUsernamePassword()

Sets the username and password on the server where the converter has to pick up the file for conversion set to "" "" if not protected

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_setOriginatingLocation(location)

Set Originating location in conversion callback

Parameters:
Name Type Description
location string

can be either "origin" or "href"

cvjs_setPanState(panState)

Enable or disable pan operations with a smaller thumbnail drawing object, thereby increasing redraw speed. For large drawings and on limited capacity devices, set this option to true.

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
panState boolean

true for pan with thumbnails, false for pan with original image

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setPasswordProtectionServerAccess(passwordprotection)

Sets password protection for Server Access

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
passwordprotection boolean

true for passwordprotection, false otherwise

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setRelativeConversionFilesFolder(converterfilespath, converterfileurlspath)

Sets CADViewer /converters/files relative path

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
converterfilespath String

converters/files/ alternative path

converterfileurlspath String

converters/files/ alternative urlpath

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setRelativeScriptsPath(scriptsPath)

Set the scripts path to folder with CADViewer javascripts

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
scriptsPath string

paths to Scripts, typically "../javascripts"

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setRestApiController(myConverterDoc)

Set the engine controller document handling conversions

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
myConverterDoc string

name of the document handling conversions

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setRestApiControllerLocation(myAXlocation)

Set the engine controller location for this library,

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
myAXlocation string

location of the server side autoXchange structure

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerAccessToPost(flag)

Sets ajax call for server access call for Post jQuery.ajax({ type: 'POST', url: serverUrl, data: JSON.stringify(object),

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
flag boolean

true for Post, false standard php case

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerAccessToServlet(flag)

Sets ajax call for server access call for Servlets jQuery.ajax({ url: "jsonservlet - cvjs_setRestApiControllerLocation + cvjs_setRestApiController", type: 'POST', dataType: 'json', data: JSON.stringify(article), contentType: 'application/json', mimeType: 'application/json',

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
flag boolean

true for servlets, false standard php case

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerBackEndUrl(ServerLocationBackEndUrl)

Pass over the current settings for ServerLocationbackendUrl

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
ServerLocationBackEndUrl string

server location of html Element on which CADViewer is located

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setServerLocationURL(ServerLocation, ServerUrl)

Pass over the current settings of the calling html document context

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
ServerLocation string

server location of html Element on which CADViewer is located

ServerUrl string

server url of html Element on which CADViewer is located

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setSpaceObjectsCustomMenu(serverFolder, fileName, flag)

Display menu with custom space icon objects for insertion

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
serverFolder *

folder of Space Object meny content, default is: /content/customInsertSpaceObjectMenu/

fileName *

filename of json file with space objects default is: cadviewercustomspacecommands.json

flag *

true to display, false to hide by default, default is false

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setSupressHyperlinkColors(supressflag)

Sets the the response of

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
supressflag boolean

true to supress hyperlink colors, false to keep standard highlight

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setSVG_outputFormatInAXConversions(mode)

Set SVG conversion control parameter for server based conversion using either SVG or JS as format.

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

true for SVG as intermediate format false for .js as intermediate format. Default is true.

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setTopMenuXML(f_div, xml_config_file, xml_config_file_location)

Loads in the top icon menu system from an XML file The XML file is in /cadviewer/app/js/menu_config/ The XML file allows custom settings of the number of menu pages, the start menu page and content of each page, based on the selection set of available API commands

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div String

div in which CADViewer is implemented

xml_config_file String

XML top menu configuration file

xml_config_file_location String

location of xml config file relative to install server location, omitting this parameter, it will use default paths

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setTopMenuXMLDirect(f_div, xml_config_file)

Loads in the top icon menu system from an XML file passed over as an string variable The XML file allows custom settings of the number of menu pages, the start menu page and content of each page, based on the selection set of available API commands

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div String

div in which CADViewer is implemented

xml_config_file String

XML top menu configuration file as a string

See:

cvjs_setUrl_singleDoubleClick(click)

Sets the click response of URl links to either single click or double click

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
click int

1: single click 2: double click

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setZoomExtentsMode(mode)

Zoom Extents on the drawing

CADViewer Internal Command Groups: zoom.

Parameters:
Name Type Description
mode int

"standard" = standard zoom extents , "top" - zoom to top , "left" - zoom to left

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_windowResize_fixedSize(doResize, widthFloorplan, heightFloorplan, floorplan)

Resize CADViewer canvas after browser window changes, automatic adjustment based on canvas size and location

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
doResize boolean

flag to do resize of canvas or not: Parameter doResize is set to false when calling cvjs_windowResize_ after initialization and loading of file. Parameter doResize is set to true when cvjs_windowResize is implemented into the function jQuery(window).resize(function() {}

widthFloorplan float

width of containing element in pixels

heightFloorplan float

height of containing element in pixels

floorplan string

name of SVG element containing canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_windowResize_position(doResize, floorplan)

Resize CADViewer canvas after browser window changes, automatic adjustment based on canvas size and location

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
doResize boolean

flag to do resize of canvas or not: Parameter doResize is set to false when calling cvjs_windowResize_ after initialization and loading of file. Parameter doResize is set to true when cvjs_windowResize is implemented into the function jQuery(window).resize(function() {}

floorplan string

name of SVG element containing canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_ZoomExtents(f_div)

Zoom Extents on the drawing

CADViewer Internal Command Groups: zoom.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_zoomExtents(f_div)

Zoom Extents on the drawing

CADViewer Internal Command Groups: zoom.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_ZoomIn(f_div)

Zoom the Drawing In one step

CADViewer Internal Command Groups: zoom.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_zoomIn(f_div)

Zoom the Drawing In one step

CADViewer Internal Command Groups: zoom.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_zoomInOutCustomFactor(f_div, customZoomFactor-)

Zoom either in or out on the drawing with a custom zoom factor

CADViewer Internal Command Groups: zoom.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

customZoomFactor- float

custom zoom factor, if the factor is between 0 and 1, it zooms in, if above 1, it zooms out.

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_ZoomOut(f_div)

Zoom the drawing Out one step

CADViewer Internal Command Groups: zoom.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_zoomOut(f_div)

Zoom the drawing Out one step

CADViewer Internal Command Groups: zoom.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_ZoomWindow(f_div)

Activated the Zoom Window command

CADViewer Internal Command Groups: zoom.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_zoomWindow(f_div)

Activated the Zoom Window command

CADViewer Internal Command Groups: zoom.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_addRectangleCustomSpaceObject(f_div, svgImagePath, spaceObjectId, spaceObjectName, spaceObjectType, layer)

Add a Space Object Custom Rectangle

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

svgImagePath string

name of path containing wallpaper object

spaceObjectId string

Unique ID of the space object. NOTE!

spaceObjectName string

Name of the space object.

spaceObjectType string

Type of the object

layer string

the associated layer of the object

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_AddTextOnSpaceObject(txtLayer, Id, leftScale, textStringArr, styleArr, scaleArr, colorArr, clip, centering)

Add multiple of text, individually formatted and styled, inside a Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
txtLayer string

layer to apply the text

Id string

Id of the graphical object in which to place the text

leftScale float

distance from the left border of Space Object, value between 0 and 1

textStringArr array

Array with the lines of text

styleArr array

Array with textstyle of text lines, formattet as a java script object with css style elements, predefined is: text_style_arial_11pt_bold , text_style_arial_9pt_normal, text_style_dialog

scaleArr array

Array with relative scale of text lines in relation to space object height, value between 0 and 1. If 0, using font-size in font object as is.

colorArr array

Array of color of text lines in hex form, for example: #AA00AA

clip boolean

true if clip of text inside of Space Object, false if text to cross Space Object borders

centering boolean

true if centering of text inside of Space Object, false is default

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_addUserIdToHiddenRedlineUsers(userId)

Add userId to list of redline and stickyNote users to be hidden (on load)

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
userId string

the userId to be added to the hidden users list

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_addUserIdToLockedRedlineUsers(userId)

Add userId to list of redline and stickyNote users to be locked (on load)

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
userId string

the userId to be added to the hidden users list

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_AllGroupsOff()

Turn all Object Space groups off - Object Spaces, Sticky Notes and Redlines are differentiated.

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_AllGroupsOn()

Turn all Object Space groups on - Object Spaces, Sticky Notes and Redlines are differentiated.

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_ApplyPatternOnSpaceObjectId(layer, Id, graphicalPattern, colorHex, fillOpacity)

Apply a predefined pattern on a graphical Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer string

layer to apply the pattern

Id string

Id of the graphical object to add hatches

graphicalPattern string

name of the hatch pattern, from a predefined list of patterns: "pattern_45degree_standard" "pattern_45degree_fine" "pattern_45degree_wide" "pattern_90degree_standard" "pattern_90degree_fine" "pattern_90degree_wide" "pattern_135degree_standard" "pattern_135degree_fine" "pattern_135degree_wide" "pattern_0degree_standard" "pattern_0degree_fine" "pattern_0degree_wide" "pattern_45degree_crosshatch_standard" "pattern_45degree_crosshatch_fine" "pattern_0degree_crosshatch_standard" "pattern_0degree_crosshatch_fine"

colorHex string

color of hatch in hex form, for example: #FF0000

fillOpacity float

fill opacity of pattern, value between 0 and 1

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_ApplyPatternOnSpaceObjectNode(layer, nodeId, graphicalPattern, colorHex, fillOpacity)

Apply a predefined pattern on a graphical Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer string

layer to apply the pattern

nodeId string

nodeId of the graphical object to add hatches

graphicalPattern string

name of the hatch pattern, from a predefined list of patterns: "pattern_45degree_standard" "pattern_45degree_fine" "pattern_45degree_wide" "pattern_90degree_standard" "pattern_90degree_fine" "pattern_90degree_wide" "pattern_135degree_standard" "pattern_135degree_fine" "pattern_135degree_wide" "pattern_0degree_standard" "pattern_0degree_fine" "pattern_0degree_wide" "pattern_45degree_crosshatch_standard" "pattern_45degree_crosshatch_fine" "pattern_0degree_crosshatch_standard" "pattern_0degree_crosshatch_fine"

colorHex string

color of hatch in hex form, for example: #FF0000

fillOpacity float

fill opacity of pattern, value between 0 and 1

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_ApplyPatternOnUrl(layer, nodeId, graphicalPattern, colorHex, fillOpacity)

Apply a predefined pattern on a URL

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer string

layer to apply the pattern

nodeId string

nodeId of the graphical object to add hatches

graphicalPattern string

name of the hatch pattern, from a predefined list of patterns: "pattern_45degree_standard" "pattern_45degree_fine" "pattern_45degree_wide" "pattern_90degree_standard" "pattern_90degree_fine" "pattern_90degree_wide" "pattern_135degree_standard" "pattern_135degree_fine" "pattern_135degree_wide" "pattern_0degree_standard" "pattern_0degree_fine" "pattern_0degree_wide" "pattern_45degree_crosshatch_standard" "pattern_45degree_crosshatch_fine" "pattern_0degree_crosshatch_standard" "pattern_0degree_crosshatch_fine"

colorHex string

color of hatch in hex form, for example: #FF0000

fillOpacity float

fill opacity of pattern, value between 0 and 1

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_ApplyRelativeLinearGradientStandard2ColorsOnSpaceObjectId(layer, Id, startColor, endColor, fillOpacity)

Apply a standard linear gradient with two colors on a graphical Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer string

layer to apply the pattern

Id string

Id of the graphical object

startColor string

start color of gradient in hex form, for example: #FF0000

endColor string

end color of gradient in hex form, for example: #00DD00

fillOpacity float

fill opacity of pattern, value between 0 and 1

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_ApplyRelativeLinearGradientStandard2ColorsOnSpaceObjectNode(layer, nodeId, startColor, endColor, fillOpacity)

Apply a standard linear gradient with two colors on a graphical Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer string

layer to apply the pattern

nodeId string

nodeId of the graphical object

startColor string

start color of gradient in hex form, for example: #FF0000

endColor string

end color of gradient in hex form, for example: #00DD00

fillOpacity float

fill opacity of pattern, value between 0 and 1

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_ApplyRelativeLinearGradientStandard3ColorsOnSpaceObjectId(layer, Id, startColor, middleColor, endColor, fillOpacity)

Apply a standard linear gradient with three colors on a graphical Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer string

layer to apply the pattern

Id string

Id of the graphical object

startColor string

start color of gradient in hex form, for example: #FF0000

middleColor string

middle color of gradient in hex form, for example: #AA00AA

endColor string

end color of gradient in hex form, for example: #00DD00

fillOpacity float

fill opacity of pattern, value between 0 and 1

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_ApplyRelativeLinearGradientStandard3ColorsOnSpaceObjectNode(layer, nodeId, startColor, middleColor, endColor, fillOpacity)

Apply a standard linear gradient with three colors on a graphical Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer string

layer to apply the pattern

nodeId string

nodeId of the graphical object

startColor string

start color of gradient in hex form, for example: #FF0000

middleColor string

middle color of gradient in hex form, for example: #AA00AA

endColor string

end color of gradient in hex form, for example: #00DD00

fillOpacity float

fill opacity of pattern, value between 0 and 1

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_ApplyRelativeRadialGradientStandard2ColorsOnSpaceObjectId(layer, Id, startColor, endColor, fillOpacity)

Apply a standard radial gradient with two colors on a graphical Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer string

layer to apply the pattern

Id string

Id of the graphical object

startColor string

start color of gradient in hex form, for example: #FF0000

endColor string

end color of gradient in hex form, for example: #00DD00

fillOpacity float

fill opacity of pattern, value between 0 and 1

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_ApplyRelativeRadialGradientStandard2ColorsOnSpaceObjectNode(layer, nodeId, startColor, endColor, fillOpacity)

Apply a standard radial gradient with two colors on a graphical Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer string

layer to apply the pattern

nodeId string

nodeId of the graphical object

startColor string

start color of gradient in hex form, for example: #FF0000

endColor string

end color of gradient in hex form, for example: #00DD00

fillOpacity float

fill opacity of pattern, value between 0 and 1

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_ApplyRelativeRadialGradientStandard3ColorsOnSpaceObjectId(layer, Id, startColor, middleColor, endColor, fillOpacity)

Apply a standard radial gradient with three colors on a graphical Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer string

layer to apply the pattern

Id string

Id of the graphical object

startColor string

start color of gradient in hex form, for example: #FF0000

middleColor string

middle color of gradient in hex form, for example: #AA00AA

endColor string

end color of gradient in hex form, for example: #00DD00

fillOpacity float

fill opacity of pattern, value between 0 and 1

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_ApplyRelativeRadialGradientStandard3ColorsOnSpaceObjectNode(layer, nodeId, startColor, middleColor, endColor, fillOpacity)

Apply a standard radial gradient with three colors on a graphical Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer string

layer to apply the pattern

nodeId string

nodeId of the graphical object

startColor string

start color of gradient in hex form, for example: #FF0000

middleColor string

middle color of gradient in hex form, for example: #AA00AA

endColor string

end color of gradient in hex form, for example: #00DD00

fillOpacity float

fill opacity of pattern, value between 0 and 1

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_clearAllRedlineHiddenUsers()

Clear all redline and stickyNote userId from hidden users list

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_clearAllRedlineLockedUsers()

Clear all redline and stickyNote userId from locked users list

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_clearLayer(layer) → {string}

Clears the current layer

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer string

name of layer to be cleared

See:
Returns:

layer - returns cleared layer

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_clearLayerDiv(layer, f_div) → {none}

Clears the current layer on a named floorplan div

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer string

name of layer to be cleared

f_div string

name of floorplan div

See:
Returns:
Type
none
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_clearTextLayer(layer) → {none}

Clears the current layer and resets Text border objects

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer string

name of layer to be cleared

See:
Returns:
Type
none
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_copyMeasurementField(f_div)

Copies the content of the measurement field to the clipboard

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_currentMaxNodeId() → {string}

Retrieves the current maximum Node Id for all Space Objects, retrieve and increment when creating new graphical objects

CADViewer Internal Command Groups: All.

Deprecated:
  • Yes
See:
Returns:

maxNode - the current maximum node id

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_currentMaxSpaceNodeId() → {string}

Retrieves the current maximum Node Id for all Space Objects on all current active floorplans, retrieve and increment when creating new graphical objects

CADViewer Internal Command Groups: All.

See:
Returns:

maxNode - the current maximum node id

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_currentMaxSpaceNodeId_FloorPlan(f_div) → {string}

Retrieves the current maximum Node Id for all Space Objects on designated floorplan, retrieve and increment when creating new graphical objects

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

the current floorplan object

See:
Returns:

maxNode - the current maximum node id

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_disableSpaceObjectDrag(flag)

Set disable of dragging of SpaceObjects, this is useful if a custom modal intrudes on a small space object in IOT use-case

Parameters:
Name Type Description
flag boolean

disable status, false is default, true to disable

cvjs_displayCustomToolTip(id)

Set a custom tooltip overwriting the standard tooltip displaying either Name or Id

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
id string

id of the custom tooltip object to be displayed

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_displayPolygonControlsPoint(f_div, objectId, showhide, type)

Display status on a control points on a polygon object on either a redline or a space object

Parameters:
Name Type Description
f_div string

floorplan div

objectId string

Id of the Redline or SpaceObject, alternative RED_ or NODE_ if Node is used

showhide string

use "show" or "hide" , default is "hide"

type string

"Redline" or "SpaceObject"

cvjs_drawSpaceObject_Circle()

Draws interactively a circle. The data object of the circle is defined as a Space Object. Prior to calling this method, cvjs_setCurrentSpaceObjectNodeValues() should be called.

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_drawSpaceObject_CopyCircle()

Draws interactively a copy of a previously defined cicle object. The data object of the circle is defined as a SpaceObject. Prior to calling this method, cvjs_setCurrentSpaceObjectNodeValues() should be called.

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_drawSpaceObject_CustomRectangle()

Draws interactively a rectangle and add a custom wallpaper. The data object of the rectangle is defined as a Space Object. Prior to calling this method, cvjs_setCurrentSpaceObjectNodeValues() should be called.

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_drawSpaceObject_FilledRedlineRectangle()

Draws interactively a filled redline rectangle. Prior to calling this method, cvjs_setCurrentRedlineValues() should be called.

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_drawSpaceObject_Polygon()

Draws interactively a polygon. The data object of the polygon is defined as a Space Object. Prior to calling this method, cvjs_setCurrentSpaceObjectNodeValues() should be called.

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_drawSpaceObject_Rectangle()

Draws interactively a rectangle. The data object of the rectangle is defined as a Space Object. Prior to calling this method, cvjs_setCurrentSpaceObjectNodeValues() should be called.

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_drawSpaceObject_RedlineArrowPolyline()

Draws interactively a redline polyline with arrow. Prior to calling this method, cvjs_setCurrentRedlineValues() should be called.

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_drawSpaceObject_RedlineCircle()

Draws interactively a Redline Ellipse . Prior to calling this method, cvjs_setCurrentRedlineValues() should be called.

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_drawSpaceObject_RedlineCloud()

Draws interactively a cloud. Prior to calling this method, cvjs_setCurrentRedlineValues() should be called.

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_drawSpaceObject_RedlineEllipse()

Draws interactively a Redline Ellipse . Prior to calling this method, cvjs_setCurrentRedlineValues() should be called.

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_drawSpaceObject_RedlineEllipseCloud()

Draws interactively a Redline Ellipse Cloud . Prior to calling this method, cvjs_setCurrentRedlineValues() should be called.

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_drawSpaceObject_RedlineFilledPolygon()

Draws interactively a redline polygon. Prior to calling this method, cvjs_setCurrentRedlineValues() should be called.

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_drawSpaceObject_RedlinePolyline()

Draws interactively a redline polyline. Prior to calling this method, cvjs_setCurrentRedlineValues() should be called.

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_drawSpaceObject_RedlineRectangle()

Draws interactively a redline rectangle. Prior to calling this method, cvjs_setCurrentRedlineValues() should be called.

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_drawSpaceObject_RedlineSingleline()

Draws interactively a single redline line. Prior to calling this method, cvjs_setCurrentRedlineValues() should be called.

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_drawStickyNoteDirect()

Draws interactively a stickynote. The data object of the sticky note is defined as a StickyNote. Prior to calling this method, cvjs_setCurrentStickyNoteValues() should be called.

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_dynamicResizeTextOnSpaceObject(nodeUnderbar)

Dynamic resize and change location of text objects drawn on Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
nodeUnderbar string

the data node containing the Space Object to which the text is associated

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_dynamicResizeTextOnSpaceObject_Id(id)

Dynamic resize and change location of text objects drawn on Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
id string

the id of the data node containing the Space Object to which the text is associated

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_dynamicResizeTextOnSpaceObject_Name(name)

Dynamic resize and change location of text objects drawn on Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
name string

the name of the data node containing the Space Object to which the text is associated

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_enablePolygonControlPoints(flag)

Enable polygon control points

Parameters:
Name Type Description
flag *

true or false

cvjs_flipRedlineSpaceObject(f_div, id, orientation, type)

Flips a Redline or Space object

Parameters:
Name Type Description
f_div string

floorplan div

id string

Id of the Redline or SpaceObject, alternative RED_ or NODE_ if Node is used

orientation string

"horizontal" or "vertical"

type string

"Redline" or "SpaceObject"

cvjs_getAllRedlines_TextList() → {String}

Generate list with all redline text and their corresponding userId

CADViewer Internal Command Groups: All.

See:
Returns:

value - Returns Id, redline text list; (userid,redlinetext);(userid,redlinetext)

Type
String
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getAllRedlines_UserIdList() → {String}

Generate list with all redlines users

CADViewer Internal Command Groups: All.

See:
Returns:

value - Returns Id list, separated by ;

Type
String
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getAttributeFromSpaceObjectNode(NodeId, name) → {object}

Retrieves an attribute value from a Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
NodeId string

Node id of the Space Object in which to retrive an attribute

name string

name of attribute (name, value) pair

See:
Returns:

value - Returns the value pair corresponding to the given name

Type
object
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getAttributeStatus(NodeId) → {object}

Retrieves the attribute status from a Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
NodeId string

Node id of the Space Object in which to retrive the status

See:
Returns:

value - Returns the attributeStatus

Type
object
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getRedlineHiddenUsersList() → {String}

Lists all redline and stickyNote userId from hidden users list

CADViewer Internal Command Groups: All.

See:
Returns:

value - Returns Id list

Type
String
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getRedlineLockedUsersList() → {String}

Lists all redline and stickyNote userId from locked users list

CADViewer Internal Command Groups: All.

See:
Returns:

value - Returns Id list

Type
String
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getRedlineStyles(redid) → {*}

Returns the style object of a redline

Parameters:
Name Type Description
redid *

redlineID

Returns:

styleobject json object with Styles

Type
*

cvjs_getRedlineText(redid) → {string}

Parameters:
Name Type Description
redid string
Returns:

mystring

Type
string

cvjs_getSpaceObjectIdfromName(Name) → {object}

Returns the first Id in the Space Object structure based on an Name

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
Name string

Name of the Space Object in which to retrive the id

Returns:

value - Returns the NodeId corresponding to the given Id, -1 if not found

Type
object

cvjs_getSpaceObjectIdfromNode(Id) → {object}

Returns the first Id in the Space Object structure based on a nodeId

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
Id string

Node id of the Space Object in which to retrive the id data filed

See:
Returns:

value - Returns the id corresponding to the given nodeId, -1 if not found

Type
object
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getSpaceObjectIdList() → {array}

Returns a list with all Ids in the Space Object structure

CADViewer Internal Command Groups: All.

See:
Returns:

value - Returns Id list

Type
array
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getSpaceObjectIndexfromNode(Name) → {object}

Returns the index corresponding to a Node in the Space Object structure based

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
Name string

Name of the Space Object in which to retrive the Node id

See:
Returns:

value - Returns the NodeId corresponding to the given Id, -1 if not found

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

Type
object

cvjs_getSpaceObjectNamefromId(Id) → {object}

Returns the first Name in the Space Object structure based on an Id

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
Id string

Id of the Space Object in which to retrive the name

Returns:

value - Returns the Name corresponding to the given Id, -1 if not found

Type
object

cvjs_getSpaceObjectNamefromNode(NodeId) → {object}

Returns the first Name in the Space Object structure based on a nodeId

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
NodeId string

Node id of the Space Object in which to retrive the Name data filed

See:
Returns:

value - Returns the Name corresponding to the given nodeId, -1 if not found

Type
object
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getSpaceObjectNamesList() → {array}

Returns a list with all Names in the Space Object structure

CADViewer Internal Command Groups: All.

See:
Returns:

value - Returns Names list

Type
array
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getSpaceObjectNodefromId(Id) → {object}

Returns the first NodeId in the Space Object structure based on an Id

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
Id string

Id of the Space Object in which to retrive the Node id

See:
Returns:

value - Returns the NodeId corresponding to the given Id, -1 if not found

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

Type
object

cvjs_getSpaceObjectNodefromName(Name) → {object}

Returns the first NodeId in the Space Object structure based on an Name

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
Name string

Name of the Space Object in which to retrive the Node id

See:
Returns:

value - Returns the NodeId corresponding to the given Id, -1 if not found

Type
object
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getSpaceObjectNodeList() → {array}

Returns a list with all NODES in the Space Object structure

CADViewer Internal Command Groups: All.

See:
Returns:

value - Returns Id list

Type
array
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getSpaceObjectTypefromId(Id) → {string}

Returns the Type of a given Space Object ID

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
Id string

Id of the Space Object in which to retrive the corresponding Type

See:
Returns:

value - Returns the Type corresponding to the given Id, -1 if not found

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_GetURLParameter(sParam) → {string}

Retrieves a given parameter from the windows.location interface

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
sParam string

name of parameter to retrieve

See:
Returns:

the parameter if found, otherwise ""

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_GroupOff(layer)

Turn single Object Space group off - Object Spaces, Sticky Notes and Redlines are differentiated.

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer string

name of group to turn off

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_GroupOn(layer)

Turn single Object Space group on - Object Spaces, Sticky Notes and Redlines are differentiated.

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer string

name of group to turn on

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_GroupOn_AllOff(layer)

Turn single Object Space group on, all other groups are turned off - Object Spaces, Sticky Notes and Redlines are differentiated.

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer string

name of group to turn on

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_GroupOn_OthersOff(layer)

Turn single Object Space group on, all other groups are turned off - Object Spaces, Sticky Notes and Redlines are differentiated.

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer string

name of group to turn on

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_groupRedlineSpaceObjects(f_div, basegroup, group_array)

Groups an array of elements into a base group, the base group and elements can be Redlines of Space Objects

Parameters:
Name Type Description
f_div string

the floorplan div

basegroup string

basegroup, use ID of the Redline or SpaceObject, alternative RED_ or NODE_ if Node is used

group_array array

array of element IDs, use ID of the Redline or SpaceObject, alternative RED_ or NODE_ if Node is used

cvjs_hideAllRedlines_ExceptCurrentUser()

Hide all redlines except current userId

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_hideAllRedlines_ExceptUser(userId)

Hide all redlines except named userId

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
userId string

the userId to be displayed, all other hidden

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_hideAllRedlines_HiddenUsersList()

Hide all redlines with userId on the Hidden Users List

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_hideToolTip()

Hides the standard tooltip previously shown with cvjs_showToolTipLocation(tiptext, x, y)

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_isTouchDevice()

Detects if touch device or mouse driven device

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_lockAllRedlines_ExceptCurrentUser()

Lock all redlines except current userId

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_lockAllRedlines_ExceptUser(userId)

Lock all redlines except named userId

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
userId string

the userId to be editable, all other locked

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_lockAllRedlines_LockedUsersList()

Lock all redlines with userId on the Lock Users List

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_newLayer(layer) → {object}

Creates a new layer

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer string

name of layer to be created

See:
Returns:

layerObject - Returns a new layer as a group on the SVG canvas

Type
object
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_newLayerDiv(layer, f_div) → {object}

Creates a new layer

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer string

name of layer to be created

f_div string

name of floorplan div

See:
Returns:

layerObject - Returns a new layer as a group on the SVG canvas

Type
object
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_openHyperlinkInNewWindow(openLinkFlag, windowWidth, windowHeight)

Controls hyperlinks, so if click on a hyperlink shall open the link in the same instance or open the link in a new window. Default is false.

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
openLinkFlag boolean

true if to open links in new window, false otherwise

windowWidth int

width of new popup window, set an arbitary value if openLinkFlag is false

windowHeight int

height of new popup window, set an arbitary value if openLinkFlag is false

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_polygonControlsPointsStyle(controlPointsStyleObject)

JSON object containing styling of individial control points in REDLINE

Parameters:
Name Type Description
controlPointsStyleObject object

cvjs_PrintToPDFWindowRelativeSize(factor)

Sets the size of the pop-up browser page with the resulting Print To PDF file

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
factor float

pop-up window relative screen size, a value between 0 and 1, default is 0.4

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_removeHandleFunc_RedlineGeneric()

Remove REDLINE HANDLES IS NOW GENERIC 9.90.1 9.90.2

cvjs_replaceRedlineText(redid, mystring)

Replace a redline text object

Parameters:
Name Type Description
redid *

ID of the redline

mystring *

Replacement string

cvjs_resetTextOnSpaceObject(nodeUnderbar)

Reset the location and size of text objects drawn on Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
nodeUnderbar string

the data node containing the Space Object to which the text is associated

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_resetTextOnSpaceObject_Id(name-)

Reset the location and size of text objects drawn on Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
name- string

id of the data node containing the Space Object to which the text is associated

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_resetTextOnSpaceObject_Name(name-)

Reset the location and size of text objects drawn on Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
name- string

name of the data node containing the Space Object to which the text is associated, the first occurance of the name is selected

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_searchReplaceText(searchString, replaceString)

Text Search; finds a text string in the drawing, and zooms over the search result

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
searchString string

the text string to search after

replaceString string

the text string to replace with

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setAttributeInSpaceObjectNode(NodeId, name, value)

Sets an attribute value in a Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
NodeId string

Node id of the Space Object in which to retrive an attribute

name string

name of attribute (name, value) pair

value string

name of attribute (name, value) pair to be set

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setAttributeStatus(NodeId, attributeStatus)

Retrieves the attribute status from a Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
NodeId string

Node id of the Space Object in which to retrive the status

attributeStatus string

attributeStatus of the node, "populated" or "unpopulated"

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setCallbackForModalDisplay(callbackForkModalDisplay, customModalPopUpBody, populateMyCustomModalPopUpBody)

Space Object modals control for external retrieval of modal data.

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
callbackForkModalDisplay boolean

false: standard modal on Space Object click as defined through setup method: InitCADViewerJS_ , true: if attributesStatus in the data-field of object is "unpopulated" a call is made to external method cvjs_callbackForModalDisplay(), if attributeStatus is "populated", modal is displayed.

customModalPopUpBody function

: method that defines the body of the popup model

populateMyCustomModalPopUpBody function

: method that populates the body of the popup model, this method is called when a space is selected so the display of modal content will match the modal selected

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setCallbackMeasurement(callbackMode)

Sets measurements to be echoed through method cvjs_measurementCallback(cvjs_currentMeasurementLength, cvjs_units[cvjs_active_floorplan_div_nr]);

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
callbackMode boolean

false is default, true if measurement shall be echoed through method

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setCallbackMethod(callbackMethodName, callbackMethod)

Set Custom implementation of Callback Methods: Methods implemented: cvjs_OnLoadEnd() cvjs_graphicalObjectOnChange(type, graphicalObject, spaceID, evt)

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
callbackMethodName String

false: standard modal on Space Object click as defined through setup method: InitCADViewerJS_ , true: if attributesStatus in the data-field of object is "unpopulated" a call is made to external method cvjs_callbackForModalDisplay(), if attributeStatus is "populated", modal is displayed.

callbackMethod function

: method that defines the body of the Callback method

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setComputeSpaceObjectParentStatus(flag)

Set if Parent Status shall be computed at Space Object creation or insertion. For very large amount of space object (above 1000) computation time goes up if determine parent status

Parameters:
Name Type Description
flag bool

: flag for compute status, default is true

cvjs_setCreationMode(cvjs_supressPopUp, cvjs_creationMode, excludeID)

Sets the display mode of Space Object modals

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
cvjs_supressPopUp boolean

false: PopUp Modal on Space Object click as defined through setup method: InitCADViewer_ , true: modal is supressed, tooltip is ID of object, color setting is defined through the "linked" database field of the object.

cvjs_creationMode boolean

false: Activates creation mode colors in Space Object Creation

excludeID String

: "", ID of a space that shall not be restored after creation mode.

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setCurrentLanguage(language, f_div)

Updates all modeals and callouts based on currentLanguage

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
language int

language as a index from the XML language settings file

f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setCurrentRedlineValues_Color(currentRedline_color)

Sets the current Redlines Color value

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
currentRedline_color string

color of the Redline as a hex values, for example "#FF0000".

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setCurrentRedlineValues_ColorStokeWidth(currentRedline_color, currentRedline_StrokeWidth)

Sets the current Redlines values, color, strokewidth only, these settings will be used to intialize redlines subsequently drawn with the draw methods

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
currentRedline_color string

color of the Redline as a hex values, for example "#FF0000".

currentRedline_StrokeWidth float

width of the Redline

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setCurrentRedlineValues_FillColor(redlineFillColor)

Set the redline fill color in HEX with #

Parameters:
Name Type Description
redlineFillColor String

, the redline fill color

cvjs_setCurrentRedlineValues_FillOpacity(redlineFillOpacity)

Set the redline fill opacity

Parameters:
Name Type Description
redlineFillOpacity float

, a value between 0 and 1 defaut is 0.1

cvjs_setCurrentRedlineValues_NameUserid(currentRedline_username, currentRedline_userid)

Sets the current Redlines name and userid values, these settings will be used to intialize redlines subsequently drawn with the draw methods

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
currentRedline_username string

redline username

currentRedline_userid string

redline userid

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setCurrentRedlineValues_StrokeWidth(currentRedline_StrokeWidth)

Sets the current Redlines Stroke widthvalue

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
currentRedline_StrokeWidth float

width of the Redline

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setCurrentRedlineValues_Userid(currentRedline_userid)

Sets the current Redlines values, these settings will be used to intialize redlines subsequently drawn with the draw methods

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
currentRedline_userid string

redline userid

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setCurrentSpaceObjectNodeValues(jsonObject)

Sets the current Space Object Node values based on a JSON object created with cvjsspace_createNewJSonSpaceObject() these settings will be used to intialize space objects subsequently drawn with the draw methods var jsoncvjs_setQTipStructure = { "path": path, "tags": tags, "node": node, "area": area, "outerhtml": outerHTML, "occupancy": occupancy, "name": name, "type": type, "id": id, "defaultcolor": defaultcolor, "highlightcolor": highlightcolor, "selectcolor": selectcolor, "layer": layer, "group": group, "linked": linked, "attributes": attributes, "attributeStatus": attributeStatus, "displaySpaceObject": displaySpaceObject, "translate_x": translate_x, "translate_y": translate_y, "zvalue": "1", "scale_x": scale_x , "scale_y": scale_y , "rotate": rotate, "transform": transform, "svgx": svgx, "svgy": svgx, "dwgx": dwgx, "dwgy": dwgy , "customContent" : mycustomcontent, "pageNumber" : "", "pageName" : "", "block" : "", "blockAttributeId" : "", "blockAttributeCount" : "" "clickhandler" : "enable", "href" : "none", "parent": "none" }

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
jsonObject Object

Space Object with containing relevant values for drawing

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setCurrentStickyNoteValues(node, name, id, layer, group, text, userid, date, linked)

Sets the current Sticky Note values, these settings will be used to intialize Sticky Notes subsequently drawn with the draw methods

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
node string

the NodeId linking data with graphical objects, of the form "NOTE_xxx", where xxx is a number

name string

name of the Sticky Note - user name displayed at StickyNote modal

id string

id of the Sticky Note object, used for pop-up highlight

layer string

layer of the Sticky Note

group string

group of the Sticky Note

text string

text in the Sticky Note textfield, typically this is initially empty as users interactively add text to StickyNotes.

userid string

UserID of StickyNotes.

date string

creation date of the StickyNotes.

linked boolean

boolean variable to tell if object is linked or not, internally controlled

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setCurrentStickyNoteValues_NameUserId(currentStickyNote_name, currentStickyNote_userid)

Sets the current Sticky Note values, these settings will be used to intialize Sticky Notes subsequently drawn with the draw methods

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
currentStickyNote_name string

name of the Sticky Note - user name displayed at StickyNote modal

currentStickyNote_userid string

UserID of StickyNotes.

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setCurrentStickyNoteValues_NameUserIdDate(currentStickyNote_name, currentStickyNote_userid, currentStickyNote_date)

Sets the current Sticky Note values, these settings will be used to intialize Sticky Notes subsequently drawn with the draw methods

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
currentStickyNote_name string

name of the Sticky Note - user name displayed at StickyNote modal

currentStickyNote_userid string

UserID of StickyNotes.

currentStickyNote_date string

creation date of the StickyNotes.

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setCustomModalsContent(hbody, dual_hbody_flag, hbody2)

Sets Space Object modals to custom type

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
hbody String

String containing the body of the popUpModal

dual_hbody_flag boolean

false: flag for dual body popup

hbody2 String

second hbody, when no active space object

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setCustomToolTip(customtooltip)

Set a custom tooltip overwriting the standard tooltip displaying either Name or Id

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
customtooltip boolean

true for custom tooltip, false otherwise

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setCustomToolTipValue(id, contentArr)

Set the content of a custom tooltip, based on the id of the object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
id string

id for tooltip

contentArr arr

content for custom tooltip, array with lines of text

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setDefaulSpaceObjectColor(colorObject)

Set the default Space Object Color and LineTypes

Parameters:
Name Type Description
colorObject Object

JSON object with the space object color and line styples

cvjs_setFileModalEditMode(mode)

Controls if the File Modal shall allow edit mode

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

suppress edit mode in file modal.

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setforeignObjectInRedlineText(flag)

set foreignObject as redline text objects

Parameters:
Name Type Description
flag boolean

true for foreign object, false for base text object

cvjs_setforeignObjectSizeInRedlineText(redid, width, height)

set foreignObject text box size in a redline text object

Parameters:
Name Type Description
redid *

redline text ID

width *

width of foreign object text box

height *

height of foreign object text box

cvjs_setNoModalMode(cvjs_modalMode)

Sets the display mode of Space Object modals

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
cvjs_modalMode boolean

false: standard modal on Space Object click as defined through setup method: InitCADViewerJS_ , true: modal is supressed, standard colors on highlight

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setPrintMargins(nonprint_h, nonprint_w, standard_h, standard_w, tiny_h, tiny_w, none_h, none_w)

Set the print margins, for user margin selection in the print modal

Parameters:
Name Type Description
nonprint_h *

non print margin region vertical, default 10mm

nonprint_w *

non print margin region horizontal, default 10mm

standard_h *

non print margin region horizontal, default 18mm

standard_w *

non print margin region vertical, default 8mm

tiny_h *

non print margin region horizontal, default 6mm

tiny_w *

non print margin region vertical, default 6mm

none_h *

no margins 0mm

none_w *

no margins 0mm

cvjs_setPrintModalCustomCheckBox(mode, print_modal_custom_checkbox)

Extents the Print Modal with a custom controlled checkbox

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

Add checkbox to interface, default is false

print_modal_custom_checkbox string

name of the custom method branch

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setPrintModalCustomCheckBoxFromFile(mode, print_modal_custom_checkbox)

Extents the Print Modal with a custom controlled checkbox

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

Add checkbox to interface, default is false

print_modal_custom_checkbox string

filename containing variable definition location is ServerLocation + "/app/cv"

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setPrintModalCustomDualTextBox(mode, custom_textbox_variables_list_filename)

Extents the Print Modal with a custom controlled textbox

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

Adds a dual checkbox to interface, default is false

custom_textbox_variables_list_filename string

filename containing variable definition location is ServerLocation + "/app/cv". Content is comma separated list with names of the variable in the document to which the Text will be inserted, of type $$$title$$$

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setPrintModalCustomDualTextBoxFromFile(mode, custom_textbox_variables_list_filename)

Extents the Print Modal with a custom controlled textbox

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

Adds a dual checkbox to interface, default is false

custom_textbox_variables_list_filename string

filename containing variable definition location is ServerLocation + "/app/cv". Content is comma separated list with names of the variable in the document to which the Text will be inserted, of type $$$title$$$

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setPrintModalCustomTextBox(mode, print_modal_custom_textbox_variables_list)

Extents the Print Modal with a custom controlled textbox

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

Add checkbox to interface, default is false

print_modal_custom_textbox_variables_list string

comma separated list with names of the variable in the document to which the Text will be inserted, of type $$$title$$$

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setPrintModalCustomTextBoxFromFile(mode, custom_textbox_variables_list_filename)

Extents the Print Modal with a custom controlled textbox

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

Add checkbox to interface, default is false

custom_textbox_variables_list_filename string

filename containing variable definition location is ServerLocation + "/app/cv". Content is comma separated list with names of the variable in the document to which the Text will be inserted, of type $$$title$$$

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setPrintPaperSizeasSVGObject(mode)

Controls if the Print object in standard print shall be SVG based or based on HTML5 bitmap object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mode boolean

default is true = SVG based print object

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_setSpaceObjectCustomContent(spaceID, customContent)

Returns the first Id in the Space Object structure based on an Name in the active floorplan

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
spaceID string

ID of the Space Object

customContent object

JSON object with the custom content

cvjs_Settings(f_div)

Set Language and Conversion settings

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_showToolTipLocation(tiptext, x, y)

Show the standard tooltip in a given location

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
tiptext string

text of the tooltip to be displayed

x int

x coordinate location of the tooltip object to be displayed

y int

y coordinate location of the tooltip object to be displayed

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_sortLayers_insertAfter(layer1, layer2) → {boolean}

Sort two layers in order, insert layer2 after layer1

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer1 string

name of layer one

layer2 string

name of layer two

See:
Returns:
  • true if sorted, false otherwise
Type
boolean
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_sortLayers_prepend(layer1, layer2) → {boolean}

Sort two layers in order, prepend layer2

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer1 string

name of layer one

layer2 string

name of layer two

See:
Returns:
  • true if sorted, false otherwise
Type
boolean
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_sortLayersInOrder(layer1, layer2) → {boolean}

Sort two layers in order

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
layer1 string

name of layer one

layer2 string

name of layer two

See:
Returns:
  • true if sorted, false otherwise
Type
boolean
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_styleRedline(redid, styleobject)

Style a redline with a given color object

Parameters:
Name Type Description
redid *

redline ID

styleobject *

json object with styles

cvjs_superimposeBackgroundDrawing_PrintOutputAtDualTextbox(f_div, backgroundDrawing, top, bottom, left, right)

Superimpose a border frame or background drawing when printing and a custom print dual text box modal is checked.

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of floorplan div

backgroundDrawing string

location of background drawing, http.

top float

size of background frame border at top for adjustment of zoomed object, value between 0 and 1

bottom float

size of background frame border at bottom for adjustment of zoomed object, value between 0 and 1

left float

size of background frame border at left side for adjustment of zoomed object, value between 0 and 1

right float

size of background frame border at right side for adjustment of zoomed object, value between 0 and 1

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_superimposeBackgroundDrawing_PrintOutputAtZoom(f_div, backgroundDrawing, top, bottom, left, right)

Superimpose a border frame or background drawing when printing a zoomed in portion of the drawing

CADViewer Internal Command Groups: zoom.

Parameters:
Name Type Description
f_div string

name of floorplan div

backgroundDrawing string

location of background drawing, http.

top float

size of background frame border at top for adjustment of zoomed object, value between 0 and 1

bottom float

size of background frame border at bottom for adjustment of zoomed object, value between 0 and 1

left float

size of background frame border at left side for adjustment of zoomed object, value between 0 and 1

right float

size of background frame border at right side for adjustment of zoomed object, value between 0 and 1

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_undoDeleteLastRedline(f_div)

Undo delete of the last drawn Redline

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div String

div of the CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_ungroupRedlineSpaceObjects(f_div, basegroup, group_array)

Ungroups an array of elements into a base group, the base group and elements can be Redlines of Space Objects

Parameters:
Name Type Description
f_div string

the floorplan div

basegroup string

basegroup, use ID of the Redline or SpaceObject, alternative RED_ or NODE_ if Node is used

group_array array

array of element IDs, use ID of the Redline or SpaceObject, alternative RED_ or NODE_ if Node is used

cvjs_addCircleSpaceObject(f_div)

Add a Space Object Circle

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_addDragRectangleImageSpaceObject(f_div)

Add a Drag Size Size Image Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_addFixedSizeCustomSpaceObject(f_div, svgImagePath, spaceObjectId, spaceObjectName, spaceObjectType, layer)

Add a Fixed Size Space Object Custom Rectangle

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

svgImagePath string

name of path containing wallpaper object

spaceObjectId string

Unique ID of the space object. NOTE!

spaceObjectName string

Name of the space object.

spaceObjectType string

Type of the object

layer string

the associated layer of the object

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_addFixedSizeCustomSpaceObjectXY(f_div, image, jsonObject, c_flag, txt, scale, styles, tscale, col, left)

Add a Fixed Size Space Object Custom Rectangle at coordinates x, y JSON object created with cvjs_createNewJSonSpaceObject() these settings will be used to intialize space objects subsequently drawn with the draw methods var jsonStructure = { "path": path, "tags": tags, "node": node, "area": area, "outerhtml": outerHTML, "occupancy": occupancy, "name": name, "type": type, "id": id, "defaultcolor": defaultcolor, "highlightcolor": highlightcolor, "selectcolor": selectcolor, "layer": layer, "group": group, "linked": linked, "attributes": attributes, "attributeStatus": attributeStatus, "displaySpaceObject": displaySpaceObject, "translate_x": translate_x, "translate_y": translate_y, "zvalue": "1", "scale_x": scale_x , "scale_y": scale_y , "rotate": rotate, "transform": transform, "svgx": svgx, "svgy": svgx, "dwgx": dwgx, "dwgy": dwgy , "customContent" : mycustomcontent, "pageNumber" : "", "pageName" : "", "block" : "", "blockAttributeId" : "", "blockAttributeCount" : "" "clickhandler" : "enable", "href" : "none", "parent": "none" } CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

image string

name of path containing wallpaper object

jsonObject object

see jsonObject above with 5 fields defined, name, type, layer, id, translate_x, and translate_y

c_flag int

0 is SVG coordinates, 1 is DWG coordinates, 0 is default

txt Object

array with lines of text content in Space Object

scale float

scale factor at insertion, 1.0 is default

styles Object

object containing col and style of each line of text in the Space Object

tscale Array

array containing relative size af each line of text in the Space Object

col Array

array containing color of each line of text in the Space Object

left float

left adjustment factor of text in the Space Object

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_addFixedSizeImageSpaceObject(f_div)

Add a Fixed Size Image Space Object with

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_addFixedSizeImageSpaceObject_GlobalXY(f_div, xcor, ycor)

Add a Fixed Size Image Space Object in Global (DWG) Coordinates

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

xcor int

x coordinate in Global (DWG) coordinates

ycor int

y coordinate in Global (SVG) coordinates

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_addFixedSizeImageSpaceObjectXY(f_div, xcor, ycor)

Add a Fixed Size Image Space Object in screen coordinates

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

xcor int

x coordinate in screen coordinates

ycor int

y coordinate in screen coordinates

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_addPinMarker(f_div, spaceObjectId, spaceObjectName, spaceObjectType, layer)

Add a Pin Marker Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

spaceObjectId string

Unique ID of the space object. NOTE!

spaceObjectName string

Name of the space object.

spaceObjectType string

Type of the object

layer string

the associated layer of the object

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_addPolygonSpaceObject(f_div)

Add a Space Object Polygon

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_addRectangleSpaceObject(f_div)

Add a Space Object Rectangle - user modal

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_addSpaceObjectDirect(f_div, path, jsonObject, c_flag, txt, sf, col, txtst, scl, tcol, left)

Add a Fixed Size Space Object Custom Rectangle at coordinates x, y JSON object created with cvjs_createNewJSonSpaceObject() these settings will be used to intialize space objects subsequently drawn with the draw methods var jsonStructure = { "path": path, "tags": tags, "node": node, "area": area, "outerhtml": outerHTML, "occupancy": occupancy, "name": name, "type": type, "id": id, "defaultcolor": defaultcolor, "highlightcolor": highlightcolor, "selectcolor": selectcolor, "layer": layer, "displayStatus" : displayStatus,
"group": group, "linked": linked, "attributes": attributes, "attributeStatus": attributeStatus, "displaySpaceObject": displaySpaceObject, "translate_x": translate_x, "translate_y": translate_y, "zvalue": "1", "scale_x": scale_x , "scale_y": scale_y , "rotate": rotate, "transform": transform, "svgx": svgx, "svgy": svgx, "dwgx": dwgx, "dwgy": dwgy , "customContent" : mycustomcontent, "pageNumber" : "", "pageName" : "", "block" : "", "blockAttributeId" : "", "blockAttributeCount" : "" "clickhandler" : "enable", "href" : "none", "parent": "none" } Add a Fixed Size Space Object Custom Rectangle at coordinates x, y

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

path string

name of path containing wallpaper object

jsonObject object

see jsonObject above with 5 fields defined, name, type, id, translate_x, and translate_y

c_flag int

0 is SVG coordinates, 1 is DWG coordinates, 0 is default

txt Object

array with lines of text content in Space Object

sf float

sf factor at insertion, 1.0 is default

col Object

object containing col and style of default setting of Space Object, "none" provides standard default color

txtst Object

object containing col and style of each line of text in the Space Object

scl Array

array containing relative size af each line of text in the Space Object

tcol Array

array containing color of each line of text in the Space Object

left float

left adjustment factor of text in the Space Object

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_addSpaceObjectDirectXY(f_div, path, jsonObject, c_flag, txt, sf, col, txtst, scl, tcol, left)

Add a Fixed Size Space Object Custom Rectangle at coordinates x, y JSON object created with cvjs_createNewJSonSpaceObject() these settings will be used to intialize space objects subsequently drawn with the draw methods var jsonStructure = { "path": path, "tags": tags, "node": node, "area": area, "outerhtml": outerHTML, "occupancy": occupancy, "name": name, "type": type, "id": id, "defaultcolor": defaultcolor, "highlightcolor": highlightcolor, "selectcolor": selectcolor, "layer": layer, "displayStatus" : displayStatus,
"group": group, "linked": linked, "attributes": attributes, "attributeStatus": attributeStatus, "displaySpaceObject": displaySpaceObject, "translate_x": translate_x, "translate_y": translate_y, "zvalue": "1", "scale_x": scale_x , "scale_y": scale_y , "rotate": rotate, "transform": transform, "svgx": svgx, "svgy": svgx, "dwgx": dwgx, "dwgy": dwgy , "customContent" : mycustomcontent, "pageNumber" : "", "pageName" : "", "block" : "", "blockAttributeId" : "", "blockAttributeCount" : "" "clickhandler" : "enable", "href" : "none", "parent": "none" } Add a Fixed Size Space Object Custom Rectangle at coordinates x, y

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

path string

name of path containing wallpaper object

jsonObject object

see jsonObject above with 5 fields defined, name, type, id, translate_x, and translate_y

c_flag int

0 is SVG coordinates, 1 is DWG coordinates, 0 is default

txt Object

array with lines of text content in Space Object

sf float

sf factor at insertion, 1.0 is default

col Object

object containing col and style of default setting of Space Object, "none" provides standard default color

txtst Object

object containing col and style of each line of text in the Space Object

scl Array

array containing relative size af each line of text in the Space Object

tcol Array

array containing color of each line of text in the Space Object

left float

left adjustment factor of text in the Space Object

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_addSpaceObjectPolygon(f_div, ID, type, name, layer)

Add an interactive polygon Space Object with given ID and type

Parameters:
Name Type Description
f_div *

floorplan div

ID *

ID of the space object

type *

type of the space object

name *

type of the space object

layer *

layer on which the space object is placed

cvjs_addSpaceObjectRectangle(f_div, ID, type, name, layer)

Add an interactive rectangle Space Object with given ID and type

Parameters:
Name Type Description
f_div *

floorplan div

ID *

ID of the space object

type *

type of the space object

name *

type of the space object

layer *

layer on which the space object is placed

cvjs_ajaxPostCallbackVariable_thumbNails(callbackStatus)

Set the ajax control callback variable

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
callbackStatus boolean

set to false then monitor then true

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_buildFolderTree(FileLocation, DocumentLocation, f_div)

Build a tree structure in which to be able to load CADViewer dynamically

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
FileLocation string

location of file tree folder

DocumentLocation string

location of current document

f_div string

name of the Element in which CADViewer is running

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_changeSpaceObjectDisplayMode(f_div, displayModal)

Sets the mode of Space Object to either display or create

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

displayModal boolean

flag to display SpaceObjectEditModal, if undefined modal is true

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_changeText_On_BlockHandle(handle, textArr)

Changes visible text attribute objects on a block, referenced through its block handle

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handle string

AutoCAD block handle referecen

textArr Array.<string>

Array with the text objects to be replaced. The lenght of the array determines how many objects are replaced

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_changeText_On_BlockHandleDiv(handle, textArr, f_div) → {boolean}

Changes visible text attribute objects on a block, referenced through its block handle

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handle string

AutoCAD block handle reference

textArr Array.<string>

Array with the text objects to be replaced. The lenght of the array determines how many objects are replaced

f_div string

name of div containing CADViewer canvas

See:
Returns:

false if handle not found otherwise true

Type
boolean
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_checkBlockHandleDiv(handle, f_div) → {boolean}

Checks if a block handle is present on the floorplan

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
handle string

AutoCAD block handle reference

f_div string

name of div containing CADViewer canvas

See:
Returns:

false if handle not found otherwise true

Type
boolean
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_checkRoomHandleDiv(rmid, f_div) → {boolean}

Checks if a RoomID is present on a given floorplan

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
rmid string

Id of the Space Object to highlight

f_div string

name of the div on which the CADViewer instance is placed

See:
Returns:

false if rmid not found otherwise true

Type
boolean
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_clear_collab_redline(f_div)

Clear the redlines in collaboration session

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

Clears all image links from the canvas

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_clearQuickCounts(f_div)

Clear the quick counts counter

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_clearSpaceObjects(f_div)

Deletes all Space Objects

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_colorAllLayersInDrawing(floorplan-div, hexColor)

Toggle the color settings

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
floorplan-div string

the ID of the Element in which CADViewer is running

hexColor string

color of all layers

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_colorSingleLayer(f_div,, hexColor, layername,)

Change color on a single layer

Parameters:
Name Type Description
f_div, string

div - the ID of the Element in which CADViewer is running

hexColor string

, color of layer in HEX, with or without #

layername, string

name of layer

Add color to an xlink SVG hyperlinks to have it behave like a dynamic highlight

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
hyperlinkId string

the element of the xlink hyperlink

hyperFill string

the new fill color, of type #00FF00

hyperOpacity float

the opacity of the fill, a value between 0.0 and 1.0.

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_CompareDrawings(f_div, drawing1, drawing2)

Compare two drawings directly

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

drawing1 string

full path of drawing1

drawing2 string

full path of drawing 2

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_CompareDrawings_DisplayNameAlias(f_div, drawing1, drawing2, displayname1, displayname2)

Compare two drawings directly

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

drawing1 string

full path of drawing1

drawing2 string

full path of drawing 2

displayname1 string

display name of drawing 1

displayname2 string

display name of drawing 2

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_compareDrawings_LoadSecondDrawing(f_div)

Loads the second drawing for compare with drawing currently loaded

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_compareDrawings_ToggleDrawingOverlay(f_div)

Toggles the overlaid drawings

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_compareDrawings_ToggleDrawings(f_div)

Toggles the drawings individually

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_CompareFiles_setFileModalContent(custom_modal_dir_listing, floorPlan_div)

Sets the direct content of the file load modal instead of scanning through a designated folder

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
custom_modal_dir_listing object

a structure containing filename, url, and path

floorPlan_div String

name of the div that contains the floorplan

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_computeDynamicRedlineNamePath() → {string}

Compute a dynamic redline path, unique to each redline, matching its name and path

CADViewer Internal Command Groups: All.

See:
Returns:
  • the pathname
Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_connectTextInstances(searchString1, textInstance1, searchString1, textInstance1, lengthfactor1, lengthfactor2)

Connect Text Strings; connects two text strings with a line and arrow

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
searchString1 string

the first text string to search after

textInstance1 int

if multiple entries of text object, load instance, the first instance is 1

searchString1 string

the second text string to search after

textInstance1 int

if multiple entries of text object, load instance, the first instance is 1

lengthfactor1 int

% value, tells how many percentages line should be shorted at first text

lengthfactor2 int

% value, tells how many percentages line should be shorted at end text

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_conversion_cleanFilesDirectory()

Clean the server side temporary folder for files. This command is useful when using cvjs_conversion_setContentResponse("file"); where the server conversion provides a full set of files that is not removed when read by CADViewer

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_copyCircleSpaceObject(f_div)

Copy a Space Object Circle

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_createNewJSonSpaceObject() → {Object}

Return a new JSON structure with default content: var jsonStructure = { "path": path, "tags": tags, "node": node, "area": area, "outerhtml": outerHTML, "occupancy": occupancy, "name": name, "type": type, "id": id, "defaultcolor": defaultcolor, "highlightcolor": highlightcolor, "selectcolor": selectcolor, "layer": layer, "group": group, "linked": linked, "attributes": attributes, "attributeStatus": attributeStatus, "displaySpaceObject": displaySpaceObject, "translate_x": translate_x, "translate_y": translate_y, "zvalue": "1", "scale_x": scale_x , "scale_y": scale_y , "rotate": rotate, "transform": transform, "svgx": svgx, "svgy": svgx, "dwgx": dwgx, "dwgy": dwgy , "customContent" : mycustomcontent, "pageNumber" : "", "pageName" : "", "block" : "", "blockAttributeId" : "", "blockAttributeCount" : "" "clickhandler" : "enable", "href" : "none", "parent": "none" }

CADViewer Internal Command Groups: All.

See:
Returns:

jsonSpaceObject - Object with the entire space objects content

Type
Object
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_deleteSpaceImageObject(f_div)

Delete a Space Image Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_deleteSpaceObject(f_div)

Delete a Space Object

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_displaySpaceObjectsStructure(f_div)

Display of Space Object structure in User Mode, with enabled seach panel

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_downloadObjectAsFile(filename, object, binaryflag)

Download a stringObject

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
filename string

name of object

object string

the object object to be saved

binaryflag boolean

true to save as binary, false is text and default

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_dragBackgroundToBack_SVG(f_div)

Sends the dragging background to back - default

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of Element on which CADViewer is located

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_dragBackgroundToFront_SVG(f_div)

Brings the dragging background to front - used for drawings with static filled polygons

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of Element on which CADViewer is located

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_drawSpaceObject_FixedSize()

Draws a fixed size space and add a custom wallpaper. The data object of the rectangle is defined as a Space Object. Prior to calling this method, cvjs_setCurrentSpaceObjectNodeValues() should be called.

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_drawSpaceObject_PinMarker()

Interactively draws a custom wallpaper. The data object of the rectangle is defined as a Space Object. Prior to calling this method, cvjs_setCurrentSpaceObjectNodeValues() should be called.

CADViewer Internal Command Groups: All.

  • @example

See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.

See:

cvjs_emailScreenAsPDFwithRedlines(f_div, custom_content)

Saves a floorplan with overlays as SVG file, then embed it into a pdf and send it as email

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of Element on which CADViewer is located

custom_content object

custom controlled information

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_emailSettings_PDF_publish(from_name, from_mail, cc_mail, replyto)

Settings for email sender in the PDF publish method. When calling this method, email will be activated

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
from_name string

name of the from sender in redline PDF email

from_mail string

email address of the from sender in redline PDF email

cc_mail string

email of the cc address when sending redline PDF email

replyto string

mail of the reply to sender in redline PDF email

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_exitCompareDrawings(f_div)

Exit compare drawing and returns to base drawing

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_exitQuickCount(f_div)

Exit quick count, alternative method to double click or Esc

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_extractSVGfromCanvas(f_div) → {string}

Extracts the current SVG on canvas, including any added objects.

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of Element on which CADViewer is located

See:
Returns:

a string containg the svg object on canvas,

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getCurrentMeasurementUnit() → {string}

Returns the setting of Measurement Units on the current drawing/page from the active f_div

CADViewer Internal Command Groups: All.

See:
Returns:

units - Measurement Unit (mmn, cm, m, feet, inch)

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getStickyNoteInfo() → {string}

Get the content of all StickyNotes

CADViewer Internal Command Groups: All.

See:
Returns:

stickyNoteContent - xml wrapped content: userid, id, name, date, text, page

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getStickyNotesRedlineDXF() → {string}

Returns the current redlines and sticky notes as a string object in DXF so the user can do their own server side save bypassing php or servlet code

CADViewer Internal Command Groups: All.

See:
Returns:

RedlineNote - a string containg the redline, sticky note object

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getStickyNotesRedlineJS() → {string}

Returns the current redlines and sticky notes as a string object in JS so the user can do their own server side save bypassing php or servlet code

CADViewer Internal Command Groups: All.

See:
Returns:

RedlineNote - a string containg the redline, sticky note object

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getStickyNotesRedlineXML(stickynote_flag) → {string}

Returns the current redlines and sticky notes as a string object in XMLso the user can do their own server side save bypassing php or servlet code *

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
stickynote_flag boolean

save stickynotes as xml, default true

See:
Returns:

a string containg the redline, sticky note object

Type
string
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_getSvgToWorldUnits() → {float}

Returns the setting of SVG to World Units on the current drawing/page from the active f_div

CADViewer Internal Command Groups: All.

See:
Returns:

svgToWorldUnits - conversion factor for measurements

Type
float
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_hideNavigationMenu(mydiv)

Hide the navigation menu

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
mydiv string

name of the div on which the CADViewer instance is placed

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_initCADViewerPro_FileLoadModal(f_div)

CADViewer Pro Initialization class, to be called as part of init of base version FileLoad Module

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_initCADViewerPro_Section02(f_div)

CADViewer Pro Initialization class, to be called as part of init of base version

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_initCADViewerPro_Section03(f_div)

CADViewer Pro Initialization class, to be called as part of init of base version

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

cvjs_InitializeSVGHyperlinkClick(f_div)

Initialize xlink SVG Hyperlinks with click handler so mouse click are caught, and adds a tooltip with the xlink displayed. The return method on mouseclick is: cvjs_OnHyperlinkClick(xlink_id);

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div string

name of div containing CADViewer canvas

See:
Example
See CADViewer Reference Samples. These Samples implements selected interface commands and various API methods.  

                          

Insert image link

CADViewer Internal Command Groups: All.

Parameters:
Name Type Description
f_div