Programmatically highlight assets in a drawing
HTML Drawing Control
Programmatically highlight assets in a drawing
The HTML drawing control supports highlighting both room and non-room assets, such as equipment (eq), Jack (jk), and so on.
You can highlight assets either through a UI action (such as mouse-click or panel action) or programmatically through drawing control API.
HighlightController provides several APIs to support programmatically highlighting assets.
Highlight |
API |
Example |
Highlight a single asset with specified fill options |
highlightAsset: function(assetId, options); Where
Returns
|
drawingController.getController("HighlightController").highlightAsset('SRL;03;365B', {svgId: 'svgDiv-srl03-svg', color: 'blue', persistFill: true, overwriteFill: true}); |
Clear a single highlighted asset |
clearAsset: function(assetId, options); |
drawingController.getController("HighlightController") |
Highlight a set of assets with asset IDs as keys along with their fill options in JSON format. |
highlightAssets: function(assetsData); Where • assetData - a map of asset id and its fill options. Returns
|
var numHighlighted = drawingController.getController("HighlightController") |
Clear a set of highlighted assets. |
clearAssets: function(assetIds, options); Where • assetIds - an array of assets • options - Map of the fill option for the specified assets. |
drawingController.getController("HighlightController") |
Highlight all assets of the specified asset type with the specified fill options. |
highlightAssetsByType: function(assetType, options); Where • assetType - the specified asset's type, such as eq. • options - a map of the fill options such as defaultColor, color, prevColor, persistFill, overwriteFill, ignorePersistFill etc. Returns Number the number of assets highlighted |
var numHighlighted = drawingController() |
Clear all assets highlights of the specified asset type. |
clearAssetsByType: function(assetType, options); Where • assetType - the specified asset's type, such as eq. • options - a map of the fill options such as defaultColor, color, prevColor, persistFill, overwriteFill, ignorePersistFill etc. Returns Number the number of assets highlighted |
drawingController.getController("HighlightController") |
Clear the color of all the highlighted assets and restore to their default color when the drawing is loaded. Remove all trace lines and their linked highlighted assets. |
resetAll: function(); |
drawingController.getController("HighlightController").resetAll(); |
Retrieves all the assets that are not found by trace or highlight. |
getMissingAssets: function(type); Where
Returns
|
var missingAssets = drawingController.getController("HighlightController") |
Reset the JSON map for the missing assets of the specified type.
Resets the specified asset color to its default color, removes it from the highlighted asset map. |
resetMissingAssets: function(type); Where • type – possible values are 'highlight','trace' or not specified (all will be retrieved).
resetAsset: function(svgId, assetId); Where • svgId - the drawing SVG's id • assetId - the specified asset's id. |
|
From the panel action bar, you can also highlight multiple assets using Highlight Lablel/Selector .
Note that
clearAsset()
,
clearAssets()
, and
resetAll()
will not clear the highlights set by highlight selector.
Example view: http://localhost:8080/archibus/schema/ab-products/solutions/programming/drawing/ab-ex-dwg-html-control-highlightselector.axvw