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:

%appdata%\Roaming\Autodesk\Revit\Addins\2019\

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…

Updated source code for RevitLookup available at:
https://github.com/jeremytammik/RevitLookup/releases/tag/2017.0.0.19

Notes from The Building Coder:
In the last few weeks, it was significantly restructured to use Reflection and reduce code duplication:

revitlookup-4463299

via
http://thebuildingcoder.typepad.com/blog/2017/03/q4r4-tbc-import-and-revitlookup.html

Copy and paste files from here into C:ProgramDataAutodeskRevitAddins2016

Files from:
https://app.box.com/s/5hxbjrtgk77a80uwvycvfxinjvo9tzvt

Thanks to original post by Troy Gates at:
Revit Coaster: RevitLookup for Revit 2016

Any issues? You may have to right-click the dll and Unblock

Note: the most up to date version can always be downloaded and compiled from:
https://github.com/jeremytammik/RevitLookup/tree/2016.0.0.6

More 2016 API stuff:
The Building Coder: Revit 2016 API News and DevDays Online Recording

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?

Jeremy Tammik has upgraded RevitLookup for Revit 2015.  I compiled the latest version and have provided it here – please note it comes with no guarantees, but it worked for me.

  1. Download this and extract
  2. Run the .bat file, which will copy the .addin and .dll to your ProgramData addins folder

Or, you can manually download and compile from:

https://github.com/jeremytammik/RevitLookup

  1. Use github link above and click Download Zip
  2. Extract it
  3. Open the RevitLookup.sln in Visual Studio Express 2013 for Windows Desktop
  4. Add C:Program FilesAutodeskRevit 2015 to Reference Paths
  5. Build > Build Solution (note – this should automatically copy to Appdata folder, so you should be good to go…), or
  6. If you want to use ProgramData instead, copy RevitLookup.addin and RevitLookup.dll to:
    C:ProgramDataAutodeskRevitAddins2015 and remove them from:
    %appdata%AutodeskRevitAddins2015
  7. Open Revit 2015 and test

Original post:

The Building Coder: RevitLookup for Revit 2015

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:

  1. Select the schedule row
  2. Switch to another view (for example, a 3D view)
  3. The Properties Palette has now updated to show the properties for the Element!
  4. You can trigger normal commands – such as IDs of Selection or Save Selection

Another workaround:

  1. Install RevitLookup
  2. Select the row in the Schedule
  3. Revitlookup – Snoop Current Selection… (this will give you Element ID and other info)

This is using XP 64-bit with Revit 2013 Update 3, but similar principles will apply to other OS and software versions:

  1. Install Revit 2013 SDK if you don’t have it already, from here
  2. Install RevitAddinManager from SDKAdd-In Manager folder
  3. Open Sharpdevelop, you should be able to find it at:
    C:Program FilesAutodeskRevit Architecture 2013ProgramSDAbin
  4. Drag and drop RevitLookup.csproj to the Projects panel on the left
  5. 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.
  6. Open Revit and any project
  7. External Tools – Add-in Manager (automatic)
  8. Load the compiled RevitLookup.dll and then use the Save to Add-ins folder option
  9. Restart Revit
Now, to use RevitLookup to find the Element ID of a View Template and copy it to another project:
  1. Open a Project
  2. Add-Ins, Revit Lookup, Snoop DB…
  3. Scroll down and select the appropriate View reference, ie. ViewPlan for a Template that was created from / for a Plan View
  4. When you select it, the Element ID will be shown on the right and you can copy it to Clipboard
  5. Select By ID, Paste
  6. Ctrl+C
  7. Switch to another project
  8. Paste – Aligned to Selected Level
  9. Done 🙂