Request

Response

    Elementgroup Validation Sample Workflow

    Validating data property names, units, and types used across elementgroups in a project is a valuable QA/QC process. This sample automates this task using the AEC Data Model APIs.

    See this code sample at AEC Data Model Samples git repository

    Note: This code sample requires .NET 6.

    Before You Begin

    1. If you do not have an app registered, follow the procedure outlined in Create an App to sign up for an APS account (if required) and obtain a Client ID for your app.

      • Make sure that you add the following as the Callback URL: http://localhost:8080/api/auth/callback
      • Contact us to enable AEC Data Model API for your app and ACC hub.
    2. Install .NET 6
    3. Clone or download the Git Repository. It’s recommended to install GitHub desktop. To clone it via command line, use the following command (Terminal on MacOSX/Linux, Git Shell on Windows):

       git clone https://github.com/autodesk-platform-services/aps-aecdatamodel-samples.git
      

    Setting up the Application

    Define the following environment variables:
    
      Mac OSX/Linux (Terminal)
    
        dotnet restore
        export APS_CLIENT_ID=<<YOUR CLIENT ID FROM DEVELOPER PORTAL>>
        export APS_CLIENT_SECRET=<<YOUR CLIENT SECRET>>
        export APS_CALLBACK_URL=http://localhost:8080/api/auth/callback
    
      Windows
    
        dotnet restore
        set APS_CLIENT_ID =<<YOUR CLIENT ID FROM DEVELOPER PORTAL>>
        set APS_CLIENT_SECRET =<<YOUR CLIENT SECRET>>
        set APS_CALLBACK_URL=http://localhost:8080/api/auth/callback
    
    Show More

    When using Visual Studio Code, you can specify the environment variables listed above in a .env file in this folder, and run and debug the application directly from the editor.

    In Microsoft Visual Studio, you can set the variables through Debug > aps-aecdatamodel-samples Properties and add the three Environment variables as follows: APS_CLIENT_ID=<>,APS_CLIENT_SECRET=<>,APS_CALLBACK_URL=http://localhost:8080/api/auth/callback

    Running the Sample

    To run the sample, you need to execute the following command in the terminal:

     dotnet run
    

    Go to http://localhost:8080, and then select Go to sample for Elementgroups Validation Sample Workflow.

    go to Elementgroups validation sample

    Afterwards, you’ll need to login with your Autodesk (ACC) account before proceeding with the next steps.

    Workflow Description

    1. List all hubs

      After login (top-right), click on List Hubs and take note of the hubId (id). See C# code.

      Step 1

    2. List all projects

      Use the HubId from step 1 to list all projects and take note of the projectId (id). See C# code.

      Step 2

    3. List all properties

      This step uses projectId. Click on List all properties. See C# code.

      Step 3

      Query used in case no cursor is provided:

      
       elementGroupsByProject(projectId: $projectId) {
         pagination{
           pageSize
           cursor
         }
         results{
           name
           id
           propertyDefinitions{
             results{
               id
               name
               description
               specification
             }
           }
         }
       }
      
      Show More

      Query used in case a valid cursor is provided:

      
       elementGroupsByProject(projectId: $projectId, pagination:{cursor:"cursor string here"}) {
         pagination{
           pageSize
           cursor
         }
         results{
           name
           id
           propertyDefinitions{
             results{
               id
               name
               description
               specification
             }
           }
         }
       }
      
      Show More

      The variables are the same in both cases:

      {
        projectId = "Your project ID"
      }
      
    Was this section useful?
     
    ______
    icon-svg-close-thick

    Cookie preferences

    Your privacy is important to us and so is an optimal experience. To help us customize information and build applications, we collect data about your use of this site.

    May we collect and use your data?

    Learn more about the Third Party Services we use and our Privacy Statement.

    Strictly necessary – required for our site to work and to provide services to you

    These cookies allow us to record your preferences or login information, respond to your requests or fulfill items in your shopping cart.

    Improve your experience – allows us to show you what is relevant to you

    These cookies enable us to provide enhanced functionality and personalization. They may be set by us or by third party providers whose services we use to deliver information and experiences tailored to you. If you do not allow these cookies, some or all of these services may not be available for you.

    Customize your advertising – permits us to offer targeted advertising to you

    These cookies collect data about you based on your activities and interests in order to show you relevant ads and to track effectiveness. By collecting this data, the ads you see will be more tailored to your interests. If you do not allow these cookies, you will experience less targeted advertising.

    icon-svg-close-thick

    THIRD PARTY SERVICES

    Learn more about the Third-Party Services we use in each category, and how we use the data we collect from you online.

    icon-svg-hide-thick

    icon-svg-show-thick

    Strictly necessary – required for our site to work and to provide services to you

    Qualtrics
    W
    Akamai mPulse
    W
    Digital River
    W
    Dynatrace
    W
    Khoros
    W
    Launch Darkly
    W
    New Relic
    W
    Salesforce Live Agent
    W
    Wistia
    W
    Tealium
    W
    Upsellit
    W
    CJ Affiliates
    W
    Commission Factory
    W
    Google Analytics (Strictly Necessary)
    W
    Typepad Stats
    W
    Geo Targetly
    W
    SpeedCurve
    W
    Qualified
    #

    icon-svg-hide-thick

    icon-svg-show-thick

    Improve your experience – allows us to show you what is relevant to you

    Google Optimize
    W
    ClickTale
    W
    OneSignal
    W
    Optimizely
    W
    Amplitude
    W
    Snowplow
    W
    UserVoice
    W
    Clearbit
    #
    YouTube
    #

    icon-svg-hide-thick

    icon-svg-show-thick

    Customize your advertising – permits us to offer targeted advertising to you

    Adobe Analytics
    W
    Google Analytics (Web Analytics)
    W
    AdWords
    W
    Marketo
    W
    Doubleclick
    W
    HubSpot
    W
    Twitter
    W
    Facebook
    W
    LinkedIn
    W
    Yahoo! Japan
    W
    Naver
    W
    Quantcast
    W
    Call Tracking
    W
    Wunderkind
    W
    ADC Media
    W
    AgrantSEM
    W
    Bidtellect
    W
    Bing
    W
    G2Crowd
    W
    NMPI Display
    W
    VK
    W
    Adobe Target
    W
    Google Analytics (Advertising)
    W
    Trendkite
    W
    Hotjar
    W
    6 Sense
    W
    Terminus
    W
    StackAdapt
    W
    The Trade Desk
    W
    RollWorks
    W

    Are you sure you want a less customized experience?

    We can access your data only if you select "yes" for the categories on the previous screen. This lets us tailor our marketing so that it's more relevant for you. You can change your settings at any time by visiting our privacy statement

    Your experience. Your choice.

    We care about your privacy. The data we collect helps us understand how you use our products, what information you might be interested in, and what we can improve to make your engagement with Autodesk more rewarding.

    May we collect and use your data to tailor your experience?

    Explore the benefits of a customized experience by managing your privacy settings for this site or visit our Privacy Statement to learn more about your options.