After a new version of Revit comes out, we all take some time to catch up. Revit API developers often have to get up and running really quickly so they can upgrade their apps for Revit 2019 compatibility. The first few things you will need are: the Revit 2019 SDK and help file, RevitLookup installed, and an understanding of What’s New in the Revit 2019 API.
To install RevitLookup for Revit 2019, head over to this page and grab the latest version, currently 2019.0.0.1. Put RevitLookup.addin and RevitLookup.dll into one of your Revit Addins folders, like:
To install the Revit SDK, follow these steps:
- Install Revit 2019 (or access the install media)
- Look in the installation folder
- In the Utilities subfolder, you will find the Revit 2019 SDK installer – RevitSDK.exe
This will basically unzip a whole heap of Revit API samples and goodness into a folder of your choosing. The key thing I look for initially is the RevitAPI.chm help file. I put this somewhere I can get to it easily (like OneDrive).
Until http://www.revitapidocs.com/ is updated for Revit 2019, the help files is the best way to access information about the Revit 2019 API.
Useful links, mostly from Jeremy over at The Builder Coder:
My Revit API 2019 Notes:
- Building site export removed from API and Revit 2019
- Project browser organisation for schedules added
- Can now read the Phase Map parameter for the link. The phase map is a correspondence between phases in the host document and phases in the linked document…
As you probably know, Forge is kind of like Autodesk’s way of opening up a model API for anything and anybody to connect to (over-simplified description, I know).
If you do want to start playing with Forge, Autodesk Forge Web Services APIs.
has put together a whole lot of boilerplate code that you can deploy on Heroku. He has shared a collection of node.js-based boiler projects for the
The main page includes step-by-step workflows on how to get started, deploy the code, and test the framework:
Check it out at:
Revizto doesn’t strictly offer an API (yet) for connecting to its data. But you can use the command line to export an Excel file of all of the current issue tracker data. And you could schedule this export as a Windows Task. If you are in the habit of creating custom dashboards and connecting a whole lot of data together (as I am), then this could prove to be a pretty powerful way to access and share issue tracker data with the wider team. Further, it provides an opportunity for accessing model markup information even in a non-cloud-connected state
Here’s how to export from Revizto using the command line tool, called ReviztoConsole :
Get the Revizto Project ID by hovering over the project name in the Viewer:
The command line syntax is like this (notice the project ID):
C:\Program Files\Vizerra LLC\Revizto4\Service>ReviztoConsole issues --project 12845 --export xlsx --outfile E:\temp\12845_issue_export.xlsx
Which looks like this in Explorer:
And the Excel file looks like this:
As you can see, a lot of the issue tracker fields are available here. The Snapshot and Comment fields also may include hyperlinks to a web-hosted version of the issue snapshot as well.
Note: you can use the command ReviztoConsole projects to show a list of your current project IDs and their parent folder name on your system.
Have you ever wondered if there are API commands for addressing or automating Type Catalog information in Revit? A recent post from Jeremy Tammik covered some of this. In it, he discusses the difference between
- the embedded MEP lookup tables (which the API can address using FamilySizeTable and FamilySizeTableManager), and
- the legacy text file lookup tables, which are basically a specially formatted TXT file with the same name as the RFA.
The post is well worth a read, as he also references some useful resources in the Revit help and an AU class…
What about units in Type Catalogues? Quoting directly from The Building Coder:
Question: we’re trying to create type catalogue in txt file for Radiator family. We were trying to define a parameter in watt units, with no success. How to define header for this parameter?
Answer: Look at page 15 of Martin Schmid’s Autodesk University class handout on Creating Revit MEP Content for Engineering Coordination.
Here is a sample Exhaust Fan RFA and TXT file for you to play with.
They don’t use Watts, but should give the idea if you are not already familiar with type catalogues.
Also, the families guide provides a list of the parameter types, namely, for electrical_power: watts, kilowatts, british_thermal_units_per_second, british_thermal_units_per_hour, calories_per_second, kilocalories_per_second, volt_amperes, kilovolt_amperes, horsepower.
From original post at: http://thebuildingcoder.typepad.com/blog/2015/07/type-catalogues.html
Are you struggling to address the view Underlay, perhaps in a Dynamo definition? These images may help:
The next generation of successful designers will have one important thing in common – the ability to quickly build the tool they need to accomplish a given task. Revit macro coding is one way to do this (Dynamo is another, even powerful Excel spreadsheets can qualify as BIM tools). But if you have had limited involvement with Revit macros in the past, you might be wondering “So… What is a macro anyway?”
One good place to start would in this great little article by Troy Gates on AUGI. Here are three tips from the article to get you interested:
- I highly suggest creating the macros in the application tab so you can reuse the macros in any Revit model. If you store the macro inside the model, then it is only available to that Revit model.
- The Revit API also allows the use of Microsoft LINQ (Language Integrated Query) functions. LINQ allows you to use a database-like query system to filter the elements contained in a collection. It is much more powerful and easier to use, in my opinion, when working with collections of Revit elements.
- your code needs to define objects that the Revit API will use to interface with these. These objects are called UIDocument and Document…
Read the whole article:
Introduction to Revit Macros | AUGI
To satisfy your inner API maths hunger (surely that’s a thing?), here is how Revit “thinks” about Length:
Notice the recurring “328083…” theme? This is how it relates:
Check out the comprehensive list of Revit internal units (across all unit types) at:
Revit Units .NET API: Figure Out Revit Internal Units Per Unit Type (pt. 2) – RevitNetAddinWizard & NavisworksNetAddinWizard
The DevTV videos are one of the best ways for new Revit programmers to start to get their head around things, and they have been updated for Revit 2015. Links:
- DevTV Introduction to Revit 2015 Programming Part 1 – a short video tutorial demonstrating the basic steps to start developing with the Revit .NET API – View online | Download
- DevTV Introduction to Revit 2015 Programming Part 2 – a short video tutorial demonstrating selection and filtering API through a Room Renumbering application – View online | Download
- Revit 2015 API Labs
The Building Coder: On Handling Warnings and Failures
You might be surprised at some of the cool samples that are included in the Revit SDK – which is likely already installed on your system. Here are a few notes on pathing that may assist:
Build Revit API Samples:
C:Revit 2014 SDKSamplesSDKSamples2014.sln
Copy these files
C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETFrameworkv4.0
Modify DLL path in:
C:Revit 2014 SDKSamplesRvtSamplesCSRvtSamples.addin
C:Revit 2014 SDKSamplesRvtSamplesCSRvtSamples.dll
Save the .addin to: