Fetching model elements
To fetch model elements, do the following:
On the Model Elements page, on the Fetch pane, from the ElementCategory dropdown, select an element category.
In the ElementType dropdown, select an element type.
Click FETCH.
The elements that have your category and type selection now appear in the Group and Filter pane and the Model Elements pane.
Optional: To group elements, in the Group and Filter pane, from the Group By dropdown, select a grouping.
Optional: To filter elements, in the Group and Filter pane, from the Filter By dropdown, select a filter.
To tag fetched elements with color tags, see Color tagging elements.
For more information on a model element's related data, see Related items.
Figure: Browsing model elements on the App page

ElementCategory and ElementType dropdown data loading#
The user can use the ElementCategory and ElementType dropdowns to filter project elements by their category and type.
Data loads in the ElementCategory and ElementType dropdowns#
When the Model Elements page mounts, the getModelElements script executes and gets the BIM model element data.
In the "modelelems" handler, the script function that calls is defined in config.type.entityData.Model Element.script. The reference to the script file that contains the function is defined in modelelems.scriptTypes:
"handlers": { "modelelems": { "scriptTypes": [ "iaf_dt_model_elems", //references iaf_dt_model_elems.js in scripts/NextScriptEngine/scripts/js ... ], "config": { ... "entityData": { "Model Element": { "script": "getModelElements" } }, ... }, ...}
The ElementType and ElementCategory dropdowns, are configured in the user config and are handled and rendered by ipaCore.
"entityDataConfig": { "Model Element": { "Element Properties": { "selected": true, "isProperties": true, "component": { "name": "SimpleTableGroup", //the ipaCore component to use "className": "simple-property-grid", "groupClassName": "simple-table-group-name", "groups": { "Base Properties": [ "ElementCategory", "ElementType" ] } } }, }}The display text and script to use for each dropdown is configured in entitySelectConfig.Model Element.selects:
"entitySelectConfig": { "Model Element": [ { "id": "revfam", "query": "<<SCRIPTED_LINKED_SELECTS>>", "display": "ElementCategory", "altScript": "getModelElementsByTypeProps", "selects": [ { "display": "ElementCategory", //display text "script": "getModelElementCategory", //script that gets the model element categories "propName": "ElementCategory" }, { "display": "ElementType", //display text "script": "getModelElementType", //script that gets the model element types "multi": true, //allows the selection of multiple values "propName": "ElementType" } ] } ],...}
The getModelElementCategory function gets the model's element category collection and returns the distinct element categories:
async getModelElementCategory(input, libraries, ctx, callback) { const { PlatformApi } = libraries; let iaf_ext_current_bim_model = PlatformApi.IafScriptEngine.getVar( "iaf_ext_current_bim_model" ); let type_elements_coll = await PlatformApi.IafScriptEngine.getCollectionInComposite( iaf_ext_current_bim_model._userItemId, { _userType: "rvt_type_elements", }, ctx ); console.log("type_elements_coll", type_elements_coll); let distinctCategories = await PlatformApi.IafScriptEngine.getDistinct( { collectionDesc: { _userType: type_elements_coll._userType, _userItemId: type_elements_coll._userItemId, }, field: "ElementCategory", query: {}, }, ctx ); console.log("distinctCategories", distinctCategories); distinctCategories = _.sortBy(distinctCategories, (type) => type); return distinctCategories; },
The getModelElementType function gets the model's element types collection and returns the distinct element types:
async getModelElementType(input, libraries, ctx, callback) { console.log("input", input); const { PlatformApi } = libraries; let iaf_ext_current_bim_model = PlatformApi.IafScriptEngine.getVar( "iaf_ext_current_bim_model" ); let type_elements_coll = await PlatformApi.IafScriptEngine.getCollectionInComposite( iaf_ext_current_bim_model._userItemId, { _userType: "rvt_type_elements", }, ctx ); console.log("type_elements_coll", type_elements_coll); let distinctRevitFams = await PlatformApi.IafScriptEngine.getDistinct( { collectionDesc: { _userType: type_elements_coll._userType, _userItemId: type_elements_coll._userItemId, }, field: "ElementType", query: { ElementCategory: input.input.ElementCategory }, }, ctx ); console.log("distinctRevitFams", distinctRevitFams); distinctRevitFams = _.sortBy(distinctRevitFams, (type) => type); return distinctRevitFams;},