CADViewer JS API Reference

Members

defaultColor

default color for standard Space Object selection mode - not selected
Source:
default color for URL Hyperlinks - not selected
Source:
default color for URL Hyperlinks - not selected _ blank
Source:

defaultColor_linked

default color for Space Object supressPopUpModal mode - linked
Source:

defaultColor_unlinked

default color for Space Object supressPopUpModal mode - unlinked
Source:

fpWidth

system variable - internal variable for canvas controls during resize of browser
Source:

highlight

default color for standard Space Object selection mode - highlighted
Source:
default color for URL Hyperlinks selection mode - highlighted
Source:

highlight_linked

highlight color for Space Object supressPopUpModal mode - linked
Source:

highlight_unlinked

highlight color for Space Object supressPopUpModal mode - unlinked
Source:

isSmartPhoneOrTablet

control variable for determinating smartphone or tablet
Source:

selectColor

default color for standard Space Object selection mode - selrcted
Source:
default color for URL Hyperlinks selection mode - selected
Source:

selectColor_linked

selected color for Space Object supressPopUpModal mode - linked
Source:

selectColor_unlinked

selected color for Space Object supressPopUpModal mode - unlinked
Source:

stickyNotetimer

REDLINE /STICKYNOTE SAVE LOAD - PRINT
Source:

text_style_arial_9pt_normal

text style for adding text into Space Objects
Source:

text_style_arial_11pt_bold

text style for adding text into Space Objects
Source:

text_style_dialog

text style for adding text into Space Objects
Source:

winHeight

system variable - internal variable for canvas controls during resize of browser
Source:

winWidth

system variable - internal variable for canvas controls during resize of browser
Source:

Methods

cvjs_activateSpaceObjectModal_Id(rmid)

Activate modal on Space Object
Parameters:
Name Type Description
rmid string Id of space object modal to activate
Source:

cvjs_activateSpaceObjectModal_Node(node)

Activate modal on Space Object
Parameters:
Name Type Description
node string Node of space object modal to activate
Source:

cvjs_AddTextAndTBorderOnSpaceObject3Lines(txtLayer, nodeId, tborderId, leftScale, textId1, textString1, textStyle1, scaleText1, hexColorText1, textId2, textString2, textStyle2, scaleText2, hexColorText2, textId3, textString3, textStyle3, scaleText3, hexColorText3)

Add three lines of text, individually formatted and styled, inside a Space Object
Parameters:
Name Type Description
txtLayer string layer to apply the text
nodeId string nodeId of the graphical object in which to place the text
tborderId string Text Border Id of the new graphical object in which to place the text, of type "TBORDER_xxx"
leftScale float distance from the left border of Space Object, value between 0 and 1
textId1 string Text Id of the first text object, of type "TEXT_xxx"
textString1 string first line of text
textStyle1 object textstyle of text line 1, 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
scaleText1 string relative scale of text line 1, value between 0 and 1
hexColorText1 string color of text line 1 in hex form, for example: #AA00AA
textId2 string Text Id of the second text object, of type "TEXT_yyy"
textString2 string second line of text
textStyle2 object textstyle of text line 2, formattet as a java script object with css style elements
scaleText2 string relative scale of text line 2, value between 0 and 1
hexColorText2 string color of text line 2 in hex form, for example: #AA00AA
textId3 string Text Id of the third text object, of type "TEXT_zzz"
textString3 string third line of text
textStyle3 object textstyle of text line 3, formattet as a java script object with css style elements
scaleText3 string relative scale of text line 3, value between 0 and 1
hexColorText3 string color of text line 3 in hex form, for example: #AA00AA
Source:

cvjs_AddTextAndTBorderOnSpaceObjectId(txtLayer, Id, leftScale, textStringArr, textStyleArr, scaleTextArr, hexColorTextArr)

Add multiple of text, individually formatted and styled, inside a Space Object
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
textStyleArr 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
scaleTextArr array Array with relative scale of text lines, value between 0 and 1
hexColorTextArr array Array of color of text lines in hex form, for example: #AA00AA
Source:

cvjs_AddTextAndTBorderOnSpaceObjectNode(txtLayer, nodeId, leftScale, textStringArr, textStyleArr, scaleTextArr, hexColorTextArr)

Add multiple of text, individually formatted and styled, inside a Space Object
Parameters:
Name Type Description
txtLayer string layer to apply the text
nodeId string nodeId 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
textStyleArr 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
scaleTextArr array Array with relative scale of text lines, value between 0 and 1
hexColorTextArr array Array of color of text lines in hex form, for example: #AA00AA
Source:

cvjs_AddTextOnObject(txtLayer, nodeId, leftScale, textString1, textStyle1, scaleText1, hexColorText1, textString2, textStyle2, scaleText2, hexColorText2, textString3, textStyle3, scaleText3, hexColorText3)

Add three layers of text, individually formatted and styled, inside a Space Object
Parameters:
Name Type Description
txtLayer string layer to apply the text
nodeId string nodeId 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
textString1 string first line of text
textStyle1 object textstyle of text line 1, 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
scaleText1 string relative scale of text line 1, value between 0 and 1
hexColorText1 string color of text line 1 in hex form, for example: #AA00AA
textString2 string second line of text
textStyle2 object textstyle of text line 2, formattet as a java script object with css style elements
scaleText2 string relative scale of text line 2, value between 0 and 1
hexColorText2 string color of text line 2 in hex form, for example: #AA00AA
textString3 string third line of text
textStyle3 object textstyle of text line 3, formattet as a java script object with css style elements
scaleText3 string relative scale of text line 3, value between 0 and 1
hexColorText3 string color of text line 3 in hex form, for example: #AA00AA
Source:

cvjs_AllGroupsOff()

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

cvjs_AllGroupsOn()

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

cvjs_AllLayersOff()

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

cvjs_AllLayersOn()

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

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

Apply a predefined pattern on a graphical Space Object
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"
colorHex string color of hatch in hex form, for example: #FF0000
fillOpacity float fill opacity of pattern, value between 0 and 1
Source:

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

Apply a predefined pattern on a graphical Space Object
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"
colorHex string color of hatch in hex form, for example: #FF0000
fillOpacity float fill opacity of pattern, value between 0 and 1
Source:

cvjs_ApplyRelativeLinearGradientOnObject_layerSort(layer, nodeId, xStart, yStart, xEnd, yEnd, startColor, middleColor, endColor, fillOpacity, layer2)

Apply a linear gradient, with definition of gradient vector, with three colors on a graphical Space Object
Parameters:
Name Type Description
layer string layer to apply the pattern
nodeId string nodeId of the graphical object
xStart float gradient vector x start point, value between 0 and 1
yStart float gradient vector y start point, value between 0 and 1
xEnd float gradient vector x end point, value between 0 and 1
yEnd float gradient vector y end point, value between 0 and 1
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
layer2 string layer which to prepend the gradient layer (typically the main Space Object layer)
Source:

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

Apply a standard linear gradient with two colors on a graphical Space Object
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
Source:

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

Apply a standard linear gradient with two colors on a graphical Space Object
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
Source:

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

Apply a standard linear gradient with three colors on a graphical Space Object
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
Source:

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

Apply a standard linear gradient with three colors on a graphical Space Object
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
Source:

cvjs_ApplyRelativeRadialGradientOnObject_layerSort(layer, nodeId, xC, yC, radius, startColor, middleColor, endColor, fillOpacity, layer2)

Apply a radial gradient, with definition of gradient vector, with three colors on a graphical Space Object
Parameters:
Name Type Description
layer string layer to apply the pattern
nodeId string nodeId of the graphical object
xC float gradient vector x start point, value between 0 and 1
yC float gradient vector y start point, value between 0 and 1
radius float gradient vector radius, value between 0 and 1
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
layer2 string layer which to prepend the gradient layer (typically the main Space Object layer)
Source:

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

Apply a standard radial gradient with two colors on a graphical Space Object
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
Source:

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

Apply a standard radial gradient with two colors on a graphical Space Object
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
Source:

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

Apply a standard radial gradient with three colors on a graphical Space Object
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
Source:

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

Apply a standard radial gradient with three colors on a graphical Space Object
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
Source:
Clears the drawing from any highlight or modals active on Hyperlinks
Source:

cvjs_clearDrawingSpaceObjects()

Clears the drawing from any highlight or modals active on Space Objects
Source:

cvjs_clearDrawingStickyNotes()

Clears the drawing from any highlight or modals active on StickyNotes
Source:

cvjs_clearLayer(layer) → {none}

Clears the current layer
Parameters:
Name Type Description
layer string name of layer to be cleared
Source:
Returns:
Type
none

cvjs_currentMaxNodeId() → {string}

Retrieves the current maximum Node Id for all Space Objects, retrieve and increment when creating new graphical objects
Deprecated:
  • Yes
Source:
Returns:
maxNode - the current maximum node id
Type
string

cvjs_currentMaxSpaceNodeId() → {string}

Retrieves the current maximum Node Id for all Space Objects, retrieve and increment when creating new graphical objects
Source:
Returns:
maxNode - the current maximum node id
Type
string

cvjs_drawRedline_Freehand()

Draws interactively a freehand redline. The data object of the redline is defined as a Redline. Prior to calling this method, cvjs_setCurrentRedlineValues() should be called.
Source:

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.
Source:

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.
Source:

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.
Source:

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.
Source:

cvjs_drawStickyNote()

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.
Source:

cvjs_dynamicResizeTextOnSpaceObject(nodeUnderbar)

Dynamic resize and change location of text objects drawn on Space Object
Parameters:
Name Type Description
nodeUnderbar string the data node containing the Space Object to which the text is associated
Source:

cvjs_dynamicResizeTextOnSpaceObject_Id(id)

Dynamic resize and change location of text objects drawn on Space Object
Parameters:
Name Type Description
id string the id of the data node containing the Space Object to which the text is associated
Source:

cvjs_dynamicResizeTextOnSpaceObject_Name(name)

Dynamic resize and change location of text objects drawn on Space Object
Parameters:
Name Type Description
name string the name of the data node containing the Space Object to which the text is associated
Source:

cvjs_encapsulateUrl_callback(true:)

Encapsulate Url in JavaScript callback method cvjs_Url_callback(). Developer gets control over all hyperlinks in drawing
Parameters:
Name Type Description
true: boolean enable callback method false: disable callback method (link directly from drawing)
Source:

cvjs_firstPage()

REDLINE /STICKYNOTE SAVE LOAD - PRINT
Source:

cvjs_getAttributeFromSpaceObjectNode(NodeId, name) → {object}

Retrieves an attribute value from a Space Object
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
Source:
Returns:
value - Returns the value pair corresponding to the given name
Type
object

cvjs_getAttributeStatus(NodeId) → {object}

Retrieves the attribute status from a Space Object
Parameters:
Name Type Description
NodeId string Node id of the Space Object in which to retrive the status
Source:
Returns:
value - Returns the attributeStatus
Type
object

cvjs_getSpaceObjectIdfromNode(Id) → {object}

Returns the first Id in the Space Object structure based on a nodeId
Parameters:
Name Type Description
Id string Node id of the Space Object in which to retrive the id data filed
Source:
Returns:
value - Returns the id corresponding to the given nodeId, -1 if not found
Type
object

cvjs_getSpaceObjectNamefromId(Id) → {object}

Returns the first Name in the Space Object structure based on an Id
Parameters:
Name Type Description
Id string Id of the Space Object in which to retrive the name
Source:
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
Parameters:
Name Type Description
NodeId string Node id of the Space Object in which to retrive the Name data filed
Source:
Returns:
value - Returns the Name corresponding to the given nodeId, -1 if not found
Type
object

cvjs_getSpaceObjectNodefromId(Id) → {object}

Returns the first NodeId in the Space Object structure based on an Id
Parameters:
Name Type Description
Id string Id of the Space Object in which to retrive the Node id
Source:
Returns:
value - Returns the NodeId corresponding to the given Id, -1 if not found
Type
object

cvjs_GroupOff(layer)

Turn single Object Space group off - Object Spaces, Sticky Notes and Redlines are differentiated.
Parameters:
Name Type Description
layer string name of group to turn off
Source:

cvjs_GroupOn(layer)

Turn single Object Space group on - Object Spaces, Sticky Notes and Redlines are differentiated.
Parameters:
Name Type Description
layer string name of group to turn on
Source:

cvjs_GroupOn_AllOff(layer)

Turn single Object Space group on, all other groups are turned off - Object Spaces, Sticky Notes and Redlines are differentiated.
Parameters:
Name Type Description
layer string name of group to turn on
Source:

cvjs_GroupOn_OthersOff(layer)

Turn single Object Space group on, all other groups are turned off - Object Spaces, Sticky Notes and Redlines are differentiated.
Parameters:
Name Type Description
layer string name of group to turn on
Source:

cvjs_highlightAllSpaceObjects(roomstyle, layer)

Highlights all Space Objects with a given style on a given layer
Parameters:
Name Type Description
roomstyle object JSON formattet object containg the styling of the Space Objects
layer string layer on which to draw the highlights
Source:

cvjs_highlightSpaceObjectId(Id, roomstyle, layer)

Highlights a Space Object with a given style on a given layer
Parameters:
Name Type Description
Id string Id of the Space Object to highlight
roomstyle object JSON formattet object containg the styling of the SpaceObject
layer string layer on which to draw the highlight
Source:

cvjs_idObjectClicked() → {string}

Identify the id of the last Object Space selected - Object Spaces, Sticky Notes and Redlines are differentiated.
Source:
Returns:
objectId - The objectId is (-1) in case of no current object selected
Type
string

cvjs_InitCADViewerJS(floorplan_div)

Initializes CADViewer JS, any of the methods cvjs_InitCADViewerJS_ must always be called setting up CADViewer JS
Parameters:
Name Type Description
floorplan_div string the SVG canvas object to which CADViewer JS is allocated
Source:

cvjs_InitCADViewerJS_highLight(floorplan_div, cvjsRoomPolygonBaseAttributes, cvjsRoomPolygonHighlightAttributes, ccvjsRoomPolygonSelectAttributes)

Initializes CADViewer JS, any of the methods cvjs_InitCADViewerJS_ must always be called setting up CADViewer JS
Parameters:
Name Type Description
floorplan_div string the SVG canvas object to which CADViewer JS is allocated
cvjsRoomPolygonBaseAttributes object javascript object containing fill, color and stroke properties for display of Space Object roompolygons
cvjsRoomPolygonHighlightAttributes object javascript object containing fill, color and stroke properties for mouseover highlight of Space Object roompolygons
ccvjsRoomPolygonSelectAttributes object javascript object containing fill, color and stroke properties for select highlight of Space Object roompolygons
Source:

cvjs_InitCADViewerJS_highLight_popUp(floorplan_div, cvjsRoomPolygonBaseAttributes, cvjsRoomPolygonHighlightAttributes, cvjsRoomPolygonSelectAttributes, cvjsPopUpBody)

Initializes CADViewer JS, any of the methods cvjs_InitCADViewerJS_ must always be called setting up CADViewer JS
Parameters:
Name Type Description
floorplan_div string the SVG canvas object to which CADViewer JS is allocated
cvjsRoomPolygonBaseAttributes object javascript object containing fill, color and stroke properties for display of Space Object roompolygons
cvjsRoomPolygonHighlightAttributes object javascript object containing fill, color and stroke properties for mouseover highlight of Space Object roompolygons
cvjsRoomPolygonSelectAttributes 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
Source:

cvjs_InitCADViewerJS_highLight_popUp_dual_Id(floorplan_div, cvjsRoomPolygonBaseAttributes, cvjsRoomPolygonHighlightAttributes, ccvjsRoomPolygonSelectAttributes, cvjsPopUpBody, cvjsPopUpBody2)

Initializes CADViewer JS, any of the methods cvjs_InitCADViewerJS_ must always be called setting up CADViewer JS
Parameters:
Name Type Description
floorplan_div string the SVG canvas object to which CADViewer JS is allocated
cvjsRoomPolygonBaseAttributes object javascript object containing fill, color and stroke properties for display of Space Object roompolygons
cvjsRoomPolygonHighlightAttributes object javascript object containing fill, color and stroke properties for mouseover highlight of Space Object roompolygons
ccvjsRoomPolygonSelectAttributes 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
Source:

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.
Parameters:
Name Type Description
layer string name of layer to turn off
Source:

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.
Parameters:
Name Type Description
layer string name of layer to turn on
Source:

cvjs_LayerOn_AllOff(layer)

Turn single Object Space layer on, turn all other layers off - Object Spaces, Sticky Notes and Redlines are differentiated.
Parameters:
Name Type Description
layer string name of layer to turn on
Source:

cvjs_LayerOn_OthersOff()

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

cvjs_LoadDrawing(floorplan_div, FileNamePath, FileNameNoExtension)

Loads a drawing into CADViewer JS, this method can only be used after intialization of CADViewer JS through the cvjs_InitCADViewerJS_ methods
Parameters:
Name Type Description
floorplan_div string the SVG canvas object to which CADViewer JS is allocated
FileNamePath string the filepath to the location of the CADViewer JS drawing files to load in, the path is either absolute or relative to the document in which CADViewer JS is invoked
FileNameNoExtension string file name of the drawing without extension (CADViewer JS will automatically genrate naming and load in files associated with the file name)
Source:

cvjs_LoadDrawing_Conversion(floorplan_div, originatingFile, FileNameNoExtension, originatingUsername, originatingPassword)

Loads a DWG drawing into CADViewer JS, this method can only be used after intialization of CADViewer JS through the cvjs_InitCADViewerJS_ methods The method connects to the TailorMade Restful API for conversion of DWG and DWF files
Parameters:
Name Type Description
floorplan_div string the SVG canvas object to which CADViewer JS is allocated
originatingFile string the http path to the location of the DWG/DWF file
FileNameNoExtension string file name of the drawing without extension - CADViewer JS 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
Source:

cvjs_LoadDrawing_SVG(floorplan_div, FileNamePath, FileName, ScriptPath)

Loads a SVG drawing into CADViewer JS, this method can only be used after intialization of CADViewer JS through the cvjs_InitCADViewerJS_ methods
Parameters:
Name Type Description
floorplan_div string the SVG canvas object to which CADViewer JS 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 JS is invoked
FileName string file name of the SVG drawing
ScriptPath string relative location of the javascript folder from the calling document
Source:

cvjs_newLayer(layer) → {object}

Creates a new layer
Parameters:
Name Type Description
layer string name of layer to be created
Source:
Returns:
layerObject - Returns a new layer as a group on the SVG canvas
Type
object

cvjs_NodeObjectClicked() → {string}

Identify the node identifier of the last Object Space selected - Object Spaces, Sticky Notes and Redlines are differentiated.
Source:
Returns:
nodeId - The nodeId is (-1) in case of no current object selected
Type
string

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.
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
Source:

cvjs_printCanvas()

Prints the canvas, the size of the output is the coordinate space of the SVG drawing API method linked to icon interface
Source:

cvjs_printCanvasPaperSize()

Funtion to print to papersize, based on settings provided in cvjs_setPrintOrientation(), cvjs_setPrintResolutionDpi() and cvjs_setPrintPaperSize() API method linked to icon interface
Source:

cvjs_resetTextOnSpaceObject(nodeUnderbar)

Reset the location and size of text objects drawn on Space Object
Parameters:
Name Type Description
nodeUnderbar string the data node containing the Space Object to which the text is associated
Source:

cvjs_resetTextOnSpaceObject_Id(name-)

Reset the location and size of text objects drawn on Space Object
Parameters:
Name Type Description
name- string id of the data node containing the Space Object to which the text is associated
Source:

cvjs_resetTextOnSpaceObject_Name(name-)

Reset the location and size of text objects drawn on Space Object
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
Source:

cvjs_searchReplaceText(searchString, replaceString)

Text Search; finds a text string in the drawing, and zooms over the search result
Parameters:
Name Type Description
searchString string the text string to search after
replaceString string the text string to replace with
Source:

cvjs_searchText(searchString, zoomFactor)

Text Search; finds a text string in the drawing, and zooms over the search result
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
Source:

cvjs_setAttributeInSpaceObjectNode(NodeId, name, value)

Sets an attribute value in a Space Object
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
Source:

cvjs_setAttributeStatus(NodeId, attributeStatus)

Retrieves the attribute status from a Space Object
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"
Source:

cvjs_setCallbackForModalDisplay(callbacForkModalDisplay, customModalPopUpBody, populateMyCustomModalPopUpBody)

Space Object modals control for external retrieval of modal data.
Parameters:
Name Type Description
callbacForkModalDisplay 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
Source:

cvjs_setCreationMode(cvjs_creationMode)

Sets the display mode of Space Object modals
Parameters:
Name Type Description
cvjs_creationMode boolean false: standard modal on Space Object click as defined through setup method: InitCADViewerJS_ , true: modal is supressed, tooltip is ID of object, color setting is defined through the "linked" database field of the object.
Source:

cvjs_setCurrentNodeValues(currentNode_underbar, currentNode_name, currentNode_id, currentNode_layer, currentNode_group, currentNode_attributes, currentNode_attributeStatus, currentNode_type, currentNode_tags, currentNode_occupancy, currentNode_linked)

Sets the current Space Node values, these settings will be used to intialize space objects subsequently drawn with the draw methods
Parameters:
Name Type Description
currentNode_underbar string the NodeId linking data with graphical objects, of the form "NODE_xxx", where xxx is a number
currentNode_name string name of the space object to be visualized at the modal header
currentNode_id string id of the object, used for pop-up highlight in "non-modal display" and for linking Space Objects with database entries
currentNode_layer string layer of the Space Object
currentNode_group string group of the Space Object
currentNode_attributes string a list of attributes for the Space Object
currentNode_attributeStatus string status of attributes list, can be populated or unpopulated, controls if data is pulled externally
currentNode_type string the type attribute of the Space Object, the type is displayed at the modal header
currentNode_tags string list of tags assocated with the object, for retrieval at custom developed highlight
currentNode_occupancy string tag to describe occupancy, for retrieval at custom developed highlight
currentNode_linked boolean boolean variable to tell if object is associated with a database object or not. Depending on this flag highlight will differ. deprecated
Source:

cvjs_setCurrentRedlineValues(currentRedline_underbar, currentRedline_name, currentRedline_id, currentRedline_layer, currentRedline_group, currentRedline_color, currentRedline_StrokeWidth)

Sets the current Redlines values, these settings will be used to intialize redlines subsequently drawn with the draw methods
Parameters:
Name Type Description
currentRedline_underbar string the NodeId linking data with graphical objects, of the form "RED_xxx", where xxx is a number
currentRedline_name string id of the Redline, association to user producing markup
currentRedline_id string id of the Redline
currentRedline_layer string layer of the Redline
currentRedline_group string group of the Redline
currentRedline_color string color of the Redline as a hex values, for example "#FF0000".
currentRedline_StrokeWidth float width of the Redline
Source:

cvjs_setCurrentSpaceObjectNodeValues(currentNode_underbar, currentNode_name, currentNode_id, currentNode_layer, currentNode_group, currentNode_attributes, currentNode_attributeStatus, currentNode_type, currentNode_tags, currentNode_occupancy, currentNode_linked)

Sets the current Space Node values, these settings will be used to intialize space objects subsequently drawn with the draw methods
Parameters:
Name Type Description
currentNode_underbar string the NodeId linking data with graphical obejcts, of the form "NODE_xxx", where xxx is a number
currentNode_name string name of the space object to be visualized at the modal header
currentNode_id string id of the object, used for pop-up highlight in "non-modal display" and for linking Space Objects with database entries
currentNode_layer string layer of the Space Object
currentNode_group string group of the Space Object
currentNode_attributes string a list of attributes for the Space Object
currentNode_attributeStatus string status of attributes list, can be populated or unpopulated, controls if data is pulled externally
currentNode_type string the type attribute of the Space Object, the type is displayed at the modal header
currentNode_tags string list of tags assocated with the object, for retrieval at custom developed highlight
currentNode_occupancy string tag to describe occupancy, for retrieval at custom developed highlight
currentNode_linked boolean boolean variable to tell if object is associated with a database object or not. Depending on this flag highlight will differ.
Source:

cvjs_setCurrentStickyNoteValues(currentStickyNote_underbar, currentStickyNote_name, currentStickyNote_id, currentStickyNote_layer, currentStickyNote_group, currentStickyNote_text, currentStickyNote_userid, currentStickyNote_date, currentStickyNote_linked)

Sets the current Sticky Note values, these settings will be used to intialize Sticky Notes subsequently drawn with the draw methods
Parameters:
Name Type Description
currentStickyNote_underbar string the NodeId linking data with graphical objects, of the form "NOTE_xxx", where xxx is a number
currentStickyNote_name string name of the Sticky Note - user name displayed at StickyNote modal
currentStickyNote_id string id of the Sticky Note object, used for pop-up highlight
currentStickyNote_layer string layer of the Sticky Note
currentStickyNote_group string group of the Sticky Note
currentStickyNote_text string text in the Sticky Note textfield, typically this is initially empty as users interactively add text to StickyNotes.
currentStickyNote_userid string UserID of StickyNotes.
currentStickyNote_date string creation date of the StickyNotes.
currentStickyNote_linked boolean boolean variable to tell if object is linked or not, internally controlled
Source:

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.
Parameters:
Name Type Description
panState boolean true for pan with thumbnails, false for pan with original image
Source:

cvjs_setPrintOrientation(orientation)

Sets the print orientation
Parameters:
Name Type Description
orientation string print orientation, portrait or landscape
Source:

cvjs_setPrintPaperSize(papersize)

Sets the paper size of print output
Parameters:
Name Type Description
papersize string String containg paper size, allowed settings are: A4, A3, A2, US LETTER, ANSI A, ANSI B, ANSI C
Source:

cvjs_setPrintResolutionDpi(dpi)

Sets the print resolution
Parameters:
Name Type Description
dpi int print resolution in dpi, minumum is 75dpi, standard is 300
Source:

cvjs_setUrl_singleDoubleClick(click)

Sets the click response of URl links to either single click or double click
Parameters:
Name Type Description
click int 1: single click 2: double click
Source:

cvjs_sortLayers_insertAfter(layer1, layer2) → {boolean}

Sort two layers in order, insert layer2 after layer1
Parameters:
Name Type Description
layer1 string name of layer one
layer2 string name of layer two
Source:
Returns:
- true if sorted, false otherwise
Type
boolean

cvjs_sortLayers_prepend(layer1, layer2) → {boolean}

Sort two layers in order, prepend layer2
Parameters:
Name Type Description
layer1 string name of layer one
layer2 string name of layer two
Source:
Returns:
- true if sorted, false otherwise
Type
boolean

cvjs_sortLayersInOrder(layer1, layer2) → {boolean}

Sort two layers in order
Parameters:
Name Type Description
layer1 string name of layer one
layer2 string name of layer two
Source:
Returns:
- true if sorted, false otherwise
Type
boolean

cvjs_StickyNoteClicked() → {string}

Identify the node identifier of the last Sticky Note selected - Object Spaces, Sticky Notes and Redlines are differentiated.
Source:
Returns:
nodeId - The nodeId is (-1) in case of no current object selected
Type
string

cvjs_windowResize(doResize, topRows, widthReduction, floorplan, wrapper)

Resize CADViewer JS canvas after browser window changes
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 $(window).resize(function() {}
topRows int height of top rows in pixels
widthReduction int with size of external elements in pixel, full window relative canvas size
floorplan string name of SVG element containing canvas
wrapper string name of wrapper div containing floorplan canvas
Source:

cvjs_windowResize_position(doResize, floorplan)

Resize CADViewer JS canvas after browser window changes, automatic adjustment based on canvas size and location
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 $(window).resize(function() {}
floorplan string name of SVG element containing canvas
Source:

cvjs_windowResize_position_border(doResize, border, floorplan)

Resize CADViewer JS canvas after browser window changes, automatic adjustment based on canvas size and location
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 $(window).resize(function() {}
border float border size in pixels
floorplan string name of SVG element containing canvas
Source:

cvjs_windowResize_position_fixedHeightWidthRelation(doResize, hwRelation, floorplan)

Resize CADViewer JS canvas after browser window changes, automatic adjustment based on canvas size and location
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 $(window).resize(function() {}
hwRelation float relationship between height and width of canvas element
floorplan string name of SVG element containing canvas
Source:

cvjs_windowResize_scrollbar(doResize, topRows, widthReduction, floorplan, wrapper, scrollBar)

Resize CADViewer JS canvas after browser window changes, adjusts for scrollbar appearing when canvas is larger than browser window
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 $(window).resize(function() {}
topRows int height of top rows in pixels
widthReduction int with size of external elements in pixel, full window relative canvas size
floorplan string name of SVG element containing canvas
wrapper string name of wrapper div containing floorplan canvas
scrollBar int pixel size to width adjustment
Source:

cvjs_windowResize_scrollbar_bordermargin(doResize, topRows, widthReduction, floorplan, wrapper, scrollBar, borderMargin)

Resize CADViewer JS canvas after browser window changes, adjusts for scrollbar appearing when canvas is larger than browser window, adjusting for border around canvas
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 $(window).resize(function() {}
topRows int height of top rows in pixels
widthReduction int with size of external elements in pixel, full window relative canvas size
floorplan string name of SVG element containing canvas
wrapper string name of wrapper div containing floorplan canvas
scrollBar int pixel size for width adjustment
borderMargin int pixel size for width adjustment
Source: