29 Nov 2024
AEC Data Model API: new field revitElementId in ElementAlternativeIdentifiers and ElementFilterInput
A small, yet important update to AEC Data Model API. A new field revitElementId is added to the following two objects:
revitElementId represents the id of an element you see in the user interface (UI) of Revit desktop product. (e.g., Select Elements by ID feature.) This new field is supported by both standard and advanced filter options:
Note: revitElementId field is equivalent of “Revit Element Id” property. Moving forward, revitElementId will be the preferred way to retrieve and filter elements. “Revit Element Id” continues to work as backward compatibility till further notice.
Sample Usage
The code below demonstrates a sample usage of revitElementId in ElementAlternativeIdentifiers object. You can get the properties of elements with given Revit element ids as follows:
Query:
query elementGroupAtTip($elementGroupId: ID!, $filter: ElementFilterInput) {
elementGroupAtTip(elementGroupId: $elementGroupId) {
id
name
elements (filter: $filter){
results {
alternativeIdentifiers{
externalElementId,
revitElementId
},
properties {
results {
name
value
}
}
}
}
}
}
Variables:
{
"elementGroupId": "YWVjZHXXXk85RDlB",
"filter" : {
"revitElementId": ["11222","16167"]
}
}
Response:
{
"data": {
"elementGroupAtTip": {
"id": "YWVjZHXXXk85RDlB",
"name": "rac_advanced_sample_project.rvt",
"elements": {
"results": [
{
"alternativeIdentifiers": {
"externalElementId": "e3e052f9-0156-11d5-9301-0000863fxxxx-00000001",
"revitElementId": "11222"
},
"properties": {
"results": [
{
"name": "External ID",
"value": "e3e052f9-0156-11d5-9301-0000863fxxxx-00000001"
},
{
"name": "Revit Category Type Id",
"value": null
},
{
"name": "Family Name",
"value": "Project Phase Information"
},
{
"name": "Element Name",
"value": "Project Phase Information"
},
{
"name": "Element Context",
"value": "Instance"
},
{
"name": "Revit Element ID",
"value": "11222"
}
]
}
},
{
"alternativeIdentifiers": {
"externalElementId": "e3e052f9-0156-11d5-9301-0000863fxxxx-00000010",
"revitElementId": "16167"
},
"properties": {
"results": [
{
"name": "External ID",
"value": "e3e052f9-0156-11d5-9301-0000863fxxxx-00000010"
},
{
"name": "Revit Category Type Id",
"value": null
},
{
"name": "Family Name",
"value": "Dash dot"
},
{
"name": "Element Name",
"value": "Dash dot"
},
{
"name": "Element Context",
"value": "Instance"
},
{
"name": "Revit Element ID",
"value": "16167"
}
]
}
}
]
}
}
},
"extensions": {
"pointValue": {
"requestedQueryPointValue": 21
}
}
}
Notice in the above example, revitElementId is added in ElementFilterInput to filter the Revit elements. The filter object takes multiple Revit element ids as an array, separated by comma.
You can also use revitElementId with metadata. in advanced filtering option. The code snippet below demonstrates the usage:
Variables:
{
"elementGroupId": "YWVjZHXXXk85RDlB",
"filter" : {
"query": "metadata.revitElementId==11222 or metadata.revitElementId==16167"
}
}
You can find change log here.
For future updates, please subscribe APS Developer newsletter if you haven't done so, yet.