The sample is using the AEC Data Model API to retrieve individual elements properties and then adding those in a custom property panel in the Viewer. With that, we can quickly check the properties available for a specific element and even compare with the properties available with the Viewer context (generated from Model Derivative API).
- clone this repository or download
- restore the packages
- replace the variable values at appsettings.Development.json with your own
{
"APS_CLIENT_ID": "YOUR CLIENT ID",
"APS_CLIENT_SECRET": "YOUR CLIENT SECRET",
"APS_CALLBACK_URL": "http://localhost:8080/api/auth/callback"
}
Make sure your APS app also uses the same callback url!
- Provision your client id in your ACC hub.
- Follow the Onboarding to AEC Data Model instructions to activate your hub for AEC Data Model.
Once active, your hub will start generating ElementGroups from Revit 2024+ designs uploaded
As instructed in the console, you'll need to open a web browser and navigate to http://localhost:8080 in order to log into your Autodesk account
Once you logged in with your Autodesk account in the browser, you'll need to select one Revit version to render with Viewer. The sample works in a way that, as soon as you select one element, it runs a query through AEC Data Model API to return this element's properties.
The query used to retrieve the properties is based in the Hub Name
, Project Name
, File URN
and Element ID
.
It looks like the one below:
query GetPropertiesFromURN{
hubs(filter:{name:"${hubName}"}
pagination:{limit:1}){
results{
projects(filter:{name:"${projectName}"}
pagination:{limit:1}){
results{
elementGroups(filter:{fileUrn:"${fileUrn}"}
pagination:{limit:1}){
results{
elements(filter:{query: "'property.name.Element Context'==Instance and 'property.name.Revit Element ID'==${elementId}"}
pagination:{limit:1}){
results{
properties{
pagination {
cursor
}
results {
name
displayValue
definition{
units{
name
}
}
}
}
references{
results{
name
displayValue
definition{
units{
name
}
}
value{
name
properties{
results{
name
displayValue
definition{
units{
name
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
- You need to be logged in order to use any feature in this sample.
- Can't see properties for selected element: Check the console for details. It only works for designs that generated
ElementGroups
.
This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.
João Martins in/jpornelas