Autodesk 15606-011408-9300 Developer Guide - Page 161
Get MGMap object, if collection.size > 0
UPC - 606121429548
View all Autodesk 15606-011408-9300 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 161 highlights
Facilities Management Application Example Code (continued) + Function: ObjSelChanged() + + Description: on change of selection, highlight room selected + + Arguments: none + + Return: none + function ObjSelChanged() { // Get MGMap object var map = getMap(); if (map.isBusy() == false){ var selOptions = document.Selection.roomnum.options; var collection = map.createObject("MGCollection"); var sel = map.getSelection(); var mapLayer = map.getMapLayer("Offices"); // For each item selected in the list box, get the corresponding // object from the map. Keep track of them in a vector for (var i=0; i < selOptions.length; i++) { if (selOptions[i].selected){ var obj = mapLayer.getMapObject(selOptions[i].value); if (obj != null) { collection.add(obj); } } } sel.clear(); if (collection.size() > 0){ sel.addObjectsEx(collection, false); } var zoomCheck = document.Selection.ZoomOption.checked; if (zoomCheck == true){ map.zoomSelected(); } } } + Function: showOccupancy() + + Description: on change of selection, show occupancy type + + Arguments: none + + Return: none + function showOccupancy() { // Get MGMap object var map = getMap(); if (map.isBusy() == false){ var selValue = document.Selection.Status.options; for (var i=0; i < selValue.length; i++) { Facility Management Application | 161