Happy New Year to the Revit API developer community!
I spent some time during the winter break working on CSV export of room boundaries for a Forge BIM surface classification tool.
Ali Asad presented a new Visual Studio WPF MVVM Revit add-in template:
- Export room boundaries to CSV for Forge surface classification
- Visual Studio WPF MVVM Revit add-in template
A Forge BIM surface classification tool requires room boundaries to display them in the Forge viewer.
It was originally presented in 2011, and enhanced in some further discussions:
- Accessing room data.
- How to distinguish redundant rooms
- Bounding box
ExpandToContainand lower left corner of room
- 2D convex hull algorithm in C# using
I modified its output to generate the required data and export that to CSV in a number of update releases:
- 2019.0.144.14 – export room boundaries in millimetres
- 2019.0.144.13 – implemented IntPoint3d
- 2019.0.144.12 – implemented IntPoint2d
- 2019.0.144.11 – implemented onlySpaceSeparator argument for PointString and PointArrayString
- 2019.0.144.10 – remove Z component from room boundary and convex hull
- 2019.0.144.9 – implemented CSV export for CmdListAllRooms
- 2019.0.144.8 – implemented export of complete list of points of first room boundary loop
- 2019.0.144.7 – handle empty boundary curve in GetConvexHullOfRoomBoundary
Next, I might reimplement the external command as a DB-only add-in to be run in the DA4R or Forge Design Automation for Revit environment.
It empowers you to use the Visual Studio WPF template for Revit add-in development and includes:
- Well organized MVVM architecture for Revit add-in development
- WPF user control to design beautiful Revit add-in
- Auto create ribbon tab and panel
Util.csfor writing helper methods
Many thanks to Ali for sharing this useful tool!