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:
Combining Revit Lookup and Sysexporter has a lot of potential for getting hard-to-reach data out of Revit in almost realtime. For example, in Revit 2013 there are limited options for scheduling Revit Links. But if we open Revit Lookup (Snoop Database), and then start Sysexporter, we can see this (find Snoop Objects in the list and select it):
From here, we can copy that list of Revit Links to Excel and do some LEFT and RIGHT operations to strip the Element ID:
Now, we can copy a group of element IDs to the Select by ID box in Revit (maybe need a trip to Notepad++ to remove linebreaks) to multi-select a group of Links, based on their Discipline or Level. Then, you can assign them to a particular Workset. See where I’m heading with this?
Using Schedules, you can usually use Highlight in Model to find an element (or group of elements) from a schedule row.
However, this does not work if the element is hidden in the only view that it is instantiated in – for example, a single Generic Annotation entry in a Note Block (Schedule). Revit will not be able to find the element.
One workaround – interestingly, selecting a Schedule row actually selects the object/s in Revit, but at least in my configuration (Properties Palette on second monitor), it does not show the Properties in the Palette for that object while the Schedule view is active. However, you can:
Select the schedule row
Switch to another view (for example, a 3D view)
The Properties Palette has now updated to show the properties for the Element!
You can trigger normal commands – such as IDs of Selection or Save Selection
Select the row in the Schedule
Revitlookup – Snoop Current Selection… (this will give you Element ID and other info)
Drag and drop RevitLookup.csproj to the Projects panel on the left
Compile Revitlookup. Make sure to Add Reference Path (project / properties) to your Revit 2013 Program folder. Then click Build, Build Solution. I received a bunch of Warnings about obsolete classes and properties, but no errors.
Open Revit and any project
External Tools – Add-in Manager (automatic)
Load the compiled RevitLookup.dll and then use the Save to Add-ins folder option
Now, to use RevitLookup to find the Element ID of a View Template and copy it to another project:
Open a Project
Add-Ins, Revit Lookup, Snoop DB…
Scroll down and select the appropriate View reference, ie. ViewPlan for a Template that was created from / for a Plan View
When you select it, the Element ID will be shown on the right and you can copy it to Clipboard