REVIT Io PDF
REVIT Io PDF
REVIT Io PDF
Sasha Crotty
Rahul Bhobe
Ryan Duell
Learning Objectives
• Learn how Design Automation API for Revit fits into the Forge Platform
• Discover and understand ways to work with Revit models using the Design
Automation Service
• Learn about building apps with Design Automation API for Revit
• Get takeaways on how you can use these building blocks to automate your
workflows
Description
The Forge Design Automation API for Revit lets you build web applications that create, read,
and modify Revit models. We'll review the kinds of apps you will be able to build, and review the
API architecture so that you can get ready to use Design Automation for Revit in your own
applications.
Page 1
Disclaimer
Forge Design Automation API for Revit is an unreleased service which is currently in invitation-
only beta. The information in this handout is accurate as of October 30, 2017, but may change.
We may make statements regarding planned or future development efforts for our existing or
new products and services. These statements are not intended to be a promise or guarantee of
future availability of products, services or features but merely reflect our current plans and
based on factors currently known to us. These planned and future development efforts may
change without notice. Purchasing decisions should not be made based upon reliance on these
statements.
Because Design Automation API for Revit is a Forge service, you can take advantage of other
Forge services to easily connect your applications together.
The existing documentation for Design Automation API for AutoCAD is available here:
https://developer.autodesk.com/en/docs/design-automation/v2/overview/
Like other Forge services, you’ll create a Forge client application which will call our REST API
endpoints. You can use any language which can make REST calls. This client application will
also do any “front-end” work you need – displaying UI to an end-user, for example. Overall, the
Page 2
system is similar to Design Automation API for AutoCAD and the endpoints should be familiar to
someone familiar with that service.
In addition to the client application, you will create one or more Revit add-ins to execute against
the Revit engine. You will upload these to the Design Automation service and your client
application will refer to them when invoking the service. (You can keep them private or public
depending on what you want.) We’ll talk more about these add-ins in the next section.
Page 3
Workflow: Running a client application
1. You or your end user uploads their input files to a cloud location.
2. The client application POSTs a "workitem". This is a specific invocation of an activity,
indicating specific input files and an output location.
3. The Design Automation service downloads the input files.
4. The service runs your add-in against the Revit engine.
5. The service uploads the output to the specified location.
6. The client application retrieves the output, either for display to the end user or further
processing.
How can I create a Revit add-in which works with Design Automation API?
Your full client application may not be a Revit add-in specifically. It may be a website or a
standalone application. But part of your system will be a Revit add-in. This add-in is what will be
executed against Revit in the cloud when you invoke the Design Automation API.
Page 4
Even though the Forge service isn’t public today, we can explain the steps to create a Design
Automation-ready add-in now. You can use these steps to convert an existing add-in or to
create a new one.
This does not mean the add-in can only do simple tasks, just that all the inputs need to be
present up front. For example, take an add-in which does nightly data extraction from a model. It
might export all views to images, convert all schedules into the company’s format, create charts
on what changes have happened in the model over the past day, and update cost estimates.
You could structure this as one add-in or as four, depending on what you want to do and
whether you think you might reuse the pieces elsewhere. One add-in means only having to
open the model once. Four add-ins lets your client application send the work as four different
jobs and you may get intermediate results faster.
Create an IExternalDBApplication
Most Revit add-ins are external commands (IExternalCommand) or external applications
(IExternalApplication.) There is a third kind, the IExternalDBApplication, which is an add-in
which can run without Revit’s UI logic. You will not have access to Revit’s UI logic as part of
Design Automation API, so you will need to create an IExternalDBApplication.
Your add-in will have access to all the functionality in RevitAPI.dll but none of the functionality in
RevitAPIUI.dll. You should avoid using other UI libraries as well. There is no way to click on
dialogs or message boxes; the system will effectively hang if you try to present one.
If you have an existing app, splitting into UI and logic layers will allow you to run against both
desktop Revit and Design Automation API. You can preserve your existing UI functionality
within an IExternalApplication which communicates with your IExternalDBApplication.
As mentioned, a Design Automation job must have all the information it needs to run at launch
time. There is no ability to send more data or call back to the user in the middle of a job. This
can present a problem if your add-in expects to do partial calculations and then ask the user for
more input.
In this situation, you can either attempt to collect the input up front, or set up your client
application so that it run several smaller jobs. Here are two examples:
Page 5
• If your application warns a user when an operation is expected to take a long time, you
might have a user setting indicating how long to wait before cancelling.
• If your application runs into errors while trying to generate geometry, you might return
early, ask the user to make corrections, and re-submit the job.
Until the library is available, you can get a similar effect for testing purposes by subscribing to
Revit’s ApplicationInitialized event. You should not do this if you are actually running your add-in
against Design Automation, because we will do more system setup after the
ApplicationInitialized event is raised. Additionally, the framework will use the success/failure
parameter of the event to determine whether the job succeeded.
You can specify input files from cloud locations by providing a signed URL when running a
Design Automation job. The framework will download the file or files to the working directory.
If you need to communicate with an online database or something similar, your client application
will need to do this before your after your add-in runs. You may need to temporarily store your
data in an input or output file.
Page 6
How can you reach us?
We want to hear from you! We want to know your ideas for the service and we want to know
your questions about the service. (Especially if you are reading this document before AU, we
want to know what you want to know more about!)
Page 7