I used Revit 2009 API to add dimensions for elements in 3D, there is a function named NewDimension to create dimension. However, I failed to see the dimension even the function return success when I did it in 3D view (original 3D view and not rotate yet.). I tried to pass different parameter to the NewDimension API function, but all failed. After that, I tried to rotate the 3D view and tried the API again, I found when the dimension’s direction (the direction of the dimension line) is perpendicular with the view normal, we can create the dimension successfully. Then I got an idea to add dimensions for all elements in 3D view: rotate the view, then call NewDimension for those dimensions can be created, and repeat this several time, we can get all elements’ dimension. However, I found there is no API function to rotate the 3D view ( or set view normal). So finally, I have to get a workaround: let user rotate 3D view, and click the button to add dimension several times.
Generally Revit API will do what we want. But we know that Revit API is not strong enough as AutoCAD API. Sometimes it doesn’t work as expected, however, there may be some tricky way we can finish our job with some tries. This is only a small case we might meet when we develop revit apps. However, it may give some thoughts when we encounter problems using Revit API.