CADViewer Technical Documentation, Installation Guide and Reference Samples Library

JSON Structure & JSON Commands

Below are the API methods for operating on the Space Objects JSON Stucture. For manipulation of data fields inside Space Objects, see:

NOTE: When loading or saving multiple Space Objects, they will sequentially stored in a JSON element named ‘SpaceObjects’. The links below will open the command documentation in the CADViewer JavaScript API.



The SpaceObject JSON structure

The API method cvjs_createNewJSonSpaceObject() creates a default Space Object with the following structure. This is the template used for all Space Object interaction.


/**
* 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, 
*								"displaySpaceObjects": displaySpaceObjects,
*								"translate_x": translate_x, 
*								"translate_y": translate_y, 
*								"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",
*                               "parent" : "none",
*                               }
*/
function cvjs_createNewJSonSpaceObject()


Last updated on 2 May 2022
Published on 13 Mar 2020