Recently, an ADN partner reported that after migrating an existing Revit MEP add-in which used to work in RME 2012, the same code stopped working in RME 2013. The same code used to work with Revit 2012 but in Revit 2013, it throws the "failed to insert takeoff" error.
In RME 2012, even the manual steps, as has been described in details in my colleague Jeremy Tammik’s blog-post Use of NewTakeOffFitting on a Pipe, would be to:
- “Load the family into a project
- Select Pipe from the ribbon
- Select Edit Type
- Change the preferred type to Tap
- Set the pipe spud as the default tap
- Click Apply/OK
Now when you draw a branch pipe off of the main, the spud will be placed at the intersection.”
So, if users loaded a fitting manually or even programmatically using the API, and there was no fitting assigned in the pipe type for this case, the tap would try to find one in the project to use it.
But in RME 2013, piping now uses routing preferences as the container class for pipe types allowing multiple fittings to be referenced for the same fitting type and size range. It now requires the routing preference to be setup prior to using the pipe type. And since no fitting was found, it failed in our attempt, causing the exception.Following these guidelines from the Development team, setting up the routing preference and adding the spud to routing preference as the default tap prior to running the command, would fix the exception.