Well, well, well 😉
There is no API, for there is no inherent approach in Revit to do so either. A “Discipline” is not a property of a project (model), because a project of any discipline can be in theory created in Revit of any other discipline. It is not uncommon to take a model that was originally created in Revit Architecture, open in in Revit Structure to perform analysis and modify structural properties as needed, and after saving the model then open it again in Revit MEP to add ducks and pipes and such. Now, what should the model say its Discipline is?
A Discipline of a model really is nothing else than the template the model started with. It does not even have to be one of the template Revit is installed with. It’s perfectly reasonable for users to create their own templates which may be any combination of families and elements from any Revit discipline.
As there is no clear and perfectly accurate way to determine a project’s discipline, it can still be guessed and that can be done via the API, I suppose. I assume one may iterate through families currently present in a model and based on what kinds of families are find then take an educated guess on what the dominant discipline of the model may be. However, such an application should be written to also determine a model as “multi-discipline.”
Thank you
Arnošt Löbel
Sr. Principal Engineer
Autodesk, Revit R&D
Arnošt Löbel