This code sample demonstrates the usage of Model Derivative API, which allows you to convert a Revit .rvt file stored in ACC/BIM360 Docs to .ifc format.
The IFC file format is a common transfer format used throughout the world, and consumed by a wide range of applications. You can use this tool to automate tasks to convert Revit Files hosted in ACC/BIM360 Docs to IFC on a recurring basis.
Users choose either folders or specific files, then choose an IFC Settings Set name, and set a schedule on which the folders or files should be converted to IFC. At the scheduled time, the application creates model derivative jobs for each file, and uploads the IFC file into the same folder as the original Revit file. If the Revit file and IFC Settings Set name have not changed since the last conversion, no job will be created.
Note. Model Derivate API incurs cost. To view the current cost of the Model Derivative service, and to purchase Cloud Credits for file conversions, please view the APS Pricing page.
- This application will only work on Revit files that are uploaded directly to ACC/BIM360 Docs / Autodesk Docs, or published models from cloud worksharing.
- Visual Studio: Either Community 2019+ (Windows) or Code (Windows, MacOS).
- .NET 10.0
- NodeJS (with NPM) v22 or above (LTS) is required
- A supported database engine — either SQL Server or PostgreSQL:
- SQL Server (default)
- For installing SQL Server on
Windowsmachines, please see Microsoft's SQL Server installation guide - For installing SQL Server on
Linuxmachines, please see Microsoft's Installation Guidance for SQL Server - For
Cloud-hostedSQL, options include:
- For installing SQL Server on
- PostgreSQL (16 or newer recommended)
- For
Cloud-hostedPostgreSQL, options include Azure Database for PostgreSQL and Amazon RDS for PostgreSQL.
- For
- SQL Server (default)
- Basic knowledge of C#
- Autodesk APS App provisioned to your ACC/BIM360 account
Clone this project or download it. It's recommended to install GitHub desktop. To clone it via command line, use the following (Terminal on MacOSX/Linux, Git Shell on Windows):
git clone https://github.com/autodesk-platform-services/aps-revit.ifc.scheduler.git-
Visual Studio (Windows):
Open the project RevitToIfcScheduler.csproj, find appsettings.template.json in the solution window, copy and rename it to
appsettings.Development.json.
-
Visual Studio Code (Windows, MacOS):
Open the folder, at the bottom-right, select Yes and Restore. This restores the packages (e.g. Autodesk.SdkManager, Autodesk.Authentication, Autodesk.DataManagement, Autodesk.ModelDerivative, Autodesk.Oss, etc.) and creates the launch.json file.
Afterward, find appsettings.template.json in the explore window, copy and rename it to
appsettings.Development.json.
Edit the appsettings.Development.json file, adding your APS Client ID, Secret, emails for Application Admins, and your database connection string.
For SQL Server (default):
{
"ClientId": "your id here",
"ClientSecret": "your secret here",
"AdminEmails": "your admin user emails here",
"ConnectionStrings": {
"SqlDB": "Server=localhost;Database=RevitIFCScheduler;User=sa;Password=...;TrustServerCertificate=True;"
}
}For PostgreSQL, set the DatabaseProviderConfiguration.ProviderType to PostgreSQL and supply a Npgsql-format connection string:
{
"ClientId": "your id here",
"ClientSecret": "your secret here",
"AdminEmails": "your admin user emails here",
"ConnectionStrings": {
"SqlDB": "Host=localhost;Database=RevitIFCScheduler;Username=postgres;Password=..."
},
"DatabaseProviderConfiguration": {
"ProviderType": "PostgreSQL"
}
}When the DatabaseProviderConfiguration section is omitted, the application defaults to SqlServer. Both Entity Framework Core (application schema) and Hangfire (job storage) honor the selected provider. On startup, the appropriate migration set is applied automatically — SQL Server migrations live in Migrations/ and PostgreSQL migrations in Migrations/PostgreSQL/.
Run the app. Open http://localhost:3000 in your browser to view the application.
| Name | Description | Example Value |
|---|---|---|
| ClientId | From the APS App created during Setup | CL35ag54e6aghsaf4cacwe |
| ClientSecret | From the APS App created during Setup | aa46asffaws |
| AdminEmails | Semicolon-separated list of email addresses | admin@mycompany.com;bimmanager@mycompany.com |
| ConnectionStrings.SqlDB | Database connection string. Format depends on DatabaseProviderConfiguration.ProviderType. |
SQL Server: Server=MY-SERVER;Database=revit-to-ifc-scheduler;Trusted_Connection=True;ConnectRetryCount=0 || PostgreSQL: Host=MY-SERVER;Database=revit-to-ifc-scheduler;Username=postgres;Password=... |
| Name | Description | Default Value |
|---|---|---|
| DatabaseProviderConfiguration.ProviderType | Which database engine to use. Supported values: SqlServer, PostgreSQL. When the entire DatabaseProviderConfiguration section is omitted, SqlServer is used. |
SqlServer |
| AppId | A name for the application, used when naming cookies and buckets | revit-to-ifc |
| SendGridApiKey | If email notifications are desired, an API key from SendGrid should be provided | null |
| FromEmail | The email address that SendGrid should attempt to put into the 'From' field | null |
| ToEmail | The email address that SendGrid should attempt to put into the 'To' field | null |
| LogPath | The specific path where log files should be stored | null |
| IncludeShallowCopies | Copying a file in ACC/BIM360 does not create a new file, only a reference to the original file, and cannot be passed to the model derivative service. Setting this to true will make a true copy of the file, and pass that to the model derivative service. | true |
| TwoLegScope | The APS scopes used by two legged tokens | data:read data:create account:read |
| ThreeLegScope | The APS scopes used by three legged tokens | user:read data:read |
Please see the Deployment Guide.
Please see the User Guide.pdf for additional details.
-
Navigate to the tool using your browser.
-
Log in using your ACC/BIM360 account (your email address must be included in the AdminEmails Environment Setting)
-
Navigate to Settings by clicking
Settingsin the top right corner -
Toggle on the desired ACC/BIM360 accounts.
-
Add an IFC Settings Set Name using the
Add IFC Settings Set Namebutton.Note. Check out
What does an IFC Settings Set Contain?in the Further Reading section, if you don't know what it is.
- Navigate to the tool using your browser.
- Log in using your ACC/BIM360 account.
- Choose a project on the left-hand side.
- Navigate through the folder tree until you see the desired folders or files.
- Select the checkboxes next to the desired folders or files.
- Press
Convert Selected to IFC Nowin the upper right-hand corner. - Choose the desired IFC Settings Set Name, or type in a new name.
- The conversion will begin immediately, but may take several minutes to complete.
- To view the status of the conversion, press the
Conversion Historybutton to see all past conversions within this project.
- Navigate to the tool using your browser.
- Log in using your ACC/BIM360 account.
- Choose a project on the left-hand side.
- Navigate through the folder tree until you see the desired folders or files.
- Select the checkboxes next to the desired folders or files.
- Press
Create Schedule Conversionin the upper right-hand corner. - The application will automatically create a scheduled run on a daily schedule.
- You may change the following settings for the schedule:
- Schedule Name
- IFC Settings Set Name
- Frequency (Daily, Weekly, etc.)
- The days on which the schedule should repeat
- The time at which the schedule should repeat
- The time zone at which the schedule should repeat
- The conversion will begin at the next scheduled event.
- To view the status of the conversion, press the
Conversion Historybutton to see all past conversions within this project.
| Name | Description |
|---|---|
| Created | The IFC conversion job is created and enqueued successfully. |
| Processing | The Revit model has been sent to the Model Derivative service, and is being converted to IFC. |
| Converted | The model has been converted to IFC, but has not yet been uploaded to ACC/BIM360 Docs. |
| Success | The status of the IFC conversion job is success and has been uploaded to the BIM360 Docs folder where the source Revit file is. |
| Failed | The conversion or upload could not be completed. Please click the conversion record for more details. |
| Unchanged | This model has previously been converted to IFC using the same IFC setting set. No additional conversion is required. |
| ShallowCopy | The selected Revit file is a copy, rather than an uploaded file. To convert this file, set AllowShallowCopies to true in your App Settings Variables. |
| TimeOut | The APS Model Derivative service has returned a timeout error. |
Documentation:
Related knowledge:
- What is IFC?
- About Revit and IFC
- What does an IFC Settings Set Contain?
- The name list of Revit built-in IFC export settings (since Revit 2017) of APS Model Derivative service:
- IFC2x3 Coordination View 2.0
- IFC2x3 Coordination View
- IFC2x3 GSA Concept Design BIM 2010
- IFC2x3 Basic FM Handover View
- IFC2x2 Coordination View
- IFC2x2 Singapore BCA e-Plan Check
- IFC2x3 Extended FM Handover View
- IFC4 Reference View
- IFC4 Design Transfer View
- The name list of Revit built-in IFC export settings (since Revit 2017) of APS Model Derivative service:
By default, the Vite development server runs on http://localhost:5173. If port 5173 is already in use, or you want to use a different port, you need to update two places:
-
ClientApp/vite.config.js— change theserver.portvalue:server: { port: 5174, // ← your preferred port },
-
Startup.cs— pass the matching URL toViteServerMiddleware.EnsureStartedvia the optionalviteServerUrlparameter:viteUrl = Utilities.ViteServerMiddleware.EnsureStarted( env.ContentRootPath, lifetime.ApplicationStopping, viteServerUrl: "http://localhost:5174" // ← must match vite.config.js );
EnsureStarted returns the URL it used, which is then passed directly to UseProxyToSpaDevelopmentServer, so only one string needs to change on the .NET side. If Vite is already listening on the specified URL when the .NET app starts (e.g. you ran npm start manually beforehand), startup detection is skipped and the existing server is used.
This tool uses SendGrid to send a confirmation email on a successful conversion. This requires creating a free SendGrid account (for up to 25,000 emails/month), verifying a 'Single Sender' email address, and retrieving an API Key with 'Send' authorization. Three optional environment settings must be set: SendGridApiKey, FromEmail, and ToEmail. If any one of these is left blank, no emails will be sent.
SendGrid can be setup by creating an account at www.sendgrid.com, or by creating a SendGrid Accounts resource from the Azure Portal.
This application is capable of supporting multiple languages -- by default, English and Norwegian have been provided. To add additional languages, copy the folder located at aps-revit.ifc.scheduler/ClientApp/public/locales/en, and rename it with the appropriate language code. Search for the file named i18next.ts, and add the language code to the fallbackLng array. Finally, edit the translation.json and scheduler.json files in the folder that you just copied, and set the values on the right hand side to the appropriate translation.
When this is done, an additional language code will be shown in the header bar of the application.
When a file is 'shallow copied', and ACC/BIM360 makes a reference to a file that's already claimed by another BIM360 file, it can't be processed via the Model Derivative service. This happens within 'Shared' folders, and when a user makes use of the 'copy' function. The IncludeShallowCopies optional environment setting allows us to get around this, by making a copy of the file on OSS, then translating that instead.
This tool uses Entity Framework Core in a code-first, migration based setup. Provide it with a connection string, and it will automatically create or update the database and tables as needed.
When the tables are modified in the Data project, you will need to create a new Migration. Do do this, navigate to the 'BIM360 - Revit to IFC Converter' project, and run the following command: dotnet ef migrations add NameOfYourMigrationHere. The migration will be applied during the next application run.
When adding a migration, both the SQL Server and PostgreSQL migration sets must be regenerated so both providers stay in sync:
# SQL Server migration (default context, output to root Migrations/)
dotnet ef migrations add NameOfYourMigrationHere
# PostgreSQL migration (design-time-only context, output to Migrations/PostgreSQL/)
dotnet ef migrations add NameOfYourMigrationHere --context PostgreSQLRevitIfcContext --output-dir Migrations/PostgreSQLTo enable the PostgreSQL storage provider, the Hangfire packages (Hangfire.Core, Hangfire.SqlServer, Hangfire.AspNetCore) were upgraded from 1.7.28 to 1.8.14. Microsoft.EntityFrameworkCore* was bumped from 8.0.4 to 8.0.11 to match the transitive minimum of Npgsql.EntityFrameworkCore.PostgreSQL 8.0.11.
If you are upgrading an existing deployment from .NET 8 to .NET 10, be aware of the following breaking changes and required migration steps:
-
EF Core 9 — application fails to start after upgrade. EF Core 9+ throws
PendingModelChangesExceptionfromDatabase.Migrate()if the compiled model differs from the snapshot. After upgrading, add a new empty migration for both database providers before first launch:# SQL Server dotnet ef migrations add PostNet10Upgrade --context RevitIfcContext # PostgreSQL dotnet ef migrations add PostNet10Upgrade --context PostgreSQLRevitIfcContext --output-dir Migrations/PostgreSQL
This repo already ships with the
PostNet10Upgrademigrations, so no action is required for a fresh clone — this note applies to forks or branches that upgraded independently. -
Flurl.Http 3.x → 4.x — breaking HTTP API change. The
AllowHttpStatus(string)overload (e.g.AllowHttpStatus("4xx")) was removed in Flurl.Http 4.0.Utilities/APS.cshas been updated to useAllowAnyHttpStatus(). If you maintain a fork with additional Flurl HTTP call sites, review them for the same pattern. -
Serilog 2.x → 4.x — minor breaking changes. Serilog was bumped from
2.10.0to4.3.1. Review the Serilog changelog if you experience unexpected logging behavior after upgrading. -
.NET SDK 10 — NuGet transitive package audit enabled by default.
dotnet restorenow audits transitive dependencies for known CVEs and may surfaceNU1903/NU1904warnings. Review any warnings that appear and address them, or explicitly acknowledge accepted risk in your build configuration.
-
Cannot see my ACC/BIM360 projects:
- Make sure to provision the APS App Client ID within the ACC/BIM360 Account, learn more here. (This requires the Account Admin permission)
- Also, check section 2.1 Login and section 2.3.1 Enabling a BIM360 account of UserGuide.pdf for instructions.
-
Received Microsoft.Data.SqlClient.SqlException while starting this app: if it indicates that
there is already an object named 'XXXXX' in the database, then this means the database you specified inappsetings.jsonis not empty. You can fix it by doing either of the below ways:- Comment out the
dbContext.Database.Migrate();in Startup.cs, then restart the app. - Backup your database, erase the database by executing
DROP DATABASEcommand in the SQL Server Management Studio, and then restart the app.
- Comment out the
-
See 401 Unauthorized error after logging in:
- Check if the user level of the user account you logged in matches the listed roles of the section 2.1 Login of UserGuide.pdf.
- If the user level of your user account is
Application Admins, ensure that your user email is specified in theAdminEmailsof the App Settings Variables.
This application is licensed under Apache 2.0. For details, please see LICENSE.md.
- Daniel Clayson, Global Consulting Delivery Team, Autodesk
- Reviewed and maintained by Eason Kang in/eason-kang-b4398492, Developer Advocacy and Support Team


