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)
}
- cvjs_highlightSpaceObjectDirect()
- cvjs_clearHighlightSpaceObjectDirect()
- cvjs_clearAllHighlightSpaceObjectDirect()
API commands to apply Patterns when Highlight a Space Object
-
cvjs_ApplyRelativeLinearGradientStandard2ColorsOnSpaceObjectId
-
cvjs_ApplyRelativeLinearGradientStandard2ColorsOnSpaceObjectNode
-
cvjs_ApplyRelativeLinearGradientStandard3ColorsOnSpaceObjectId
-
cvjs_ApplyRelativeLinearGradientStandard3ColorsOnSpaceObjectNode
-
cvjs_ApplyRelativeRadialGradientStandard2ColorsOnSpaceObjectId
-
cvjs_ApplyRelativeRadialGradientStandard2ColorsOnSpaceObjectNode
-
cvjs_ApplyRelativeRadialGradientStandard3ColorsOnSpaceObjectId
-
cvjs_ApplyRelativeRadialGradientStandard3ColorsOnSpaceObjectNode
API commands to decorate Text on a Space Objects
- cvjs_AddTextOnObject
- cvjs_AddTextAndTBorderOnSpaceObject3Lines
- cvjs_AddTextAndTBorderOnSpaceObjectId_GlobalHeight
- cvjs_AddTextAndTBorderOnSpaceObjectId
- cvjs_AddTextAndTBorderOnSpaceObjectNode
- cvjs_AddTextAndTBorderOnSpaceObject
- cvjs_AddTextOnObjectScaleText