I’m sure you are aware that intellectually Revit shared coordinates take minutes to explain, but emotionally they take years to master 🙂

I’ve been looking for a way to check and validate coordinates using the Revit API. One method I implemented in VirtualBuiltApp is to gather Grid Intersection coordinates and compare those, but obviously you need a federated model with links to achieve that comparison.

One interesting fact to note is this:

  • two Revit models can Report functionally identical shared coordinates (same translation and true north rotation), and you can still receive “The host model and the link do not share the same coordinate system. Default center-to-center positioning will be used”. hashtag sadface, hashtag why-revit-why

If we put this another way:

  • if two models don’t have some related history (created from the same file), or
  • if Acquire or Publish Coordinates has not occurred between those models, then
  • the Shared Coordinate error will appear — even if they report identical Spot Coordinates and True North Rotation

If you are wondering what the Revit API actually does support in terms of Shared Coordinate setup and validation, here is the best bit of Revit API Shared Coordinates information I can share:

A GUID-based relationship is set up between the files. Setting up the same relationship has been possible via the API via Document.AcquireCoordinates() for a few releases.

With 2018’s SiteLocation.IsCompatibleWith() it is also possible to identify if two coordinate systems are the same.

This is part of a long thread between Dale Bartlett, Jeremy Tammik, and the Revit development team.

Also, keep in mind that BIM 360 Design (Revit Cloud Worksharing) does not support Publish Coordinates. Only Acquire Coordinates can be used in that environment.

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…

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, Philippe Leefsma 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 Autodesk Forge Web Services APIs.

The main page includes step-by-step workflows on how to get started, deploy the code, and test the framework:

Check it out at:

https://github.com/Autodesk-Forge/forge-boilers.nodejs

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

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

via
The Building Coder: On Handling Warnings and Failures