CADViewer Technical Documentation, Installation Guide and Reference Samples Library

Highlight Operations on Space Objects

A core functionality of the CADViewer Space Object API is the ability to interactively control the higlight, hatching and text decoration of Space Objects. Please see the detailed guide:


All our Integrated Samples at our GitHub repository as well as some of the Samples in this section, will contain examples of the Highlight methods below. The links below will open the command documentation in the CADViewer JavaScript API.

Core commands to Highlight a Space Object

Sample below to highlight all spaces in red.

var colortype = {    // color object to use for highlight
   fill: "FF0000",
   "fill-opacity": "0.3",
   stroke: "FFAA00",
   'stroke-width': 1,
   'stroke-opacity': "1",
   'stroke-linejoin': 'round'
 };

var spaceObjectIds = cvjs_getSpaceObjectIdList();  // get a list of all space objects
for (var spc in spaceObjectIds){		
 var rmid = spaceObjectIds[spc];
 cvjs_highlightSpace(rmid, colortype);  // highlight all spaces (on layers only)
}

API commands to apply Patterns when Highlight a Space Object

API commands to decorate Text on a Space Objects



Last updated on 16 Oct 2022
Published on 13 Mar 2020