I am currently working on an addin (C#) that generates detail sheets (among other things) automatically. I'm nearly complete except for one issue... scaling the view. I understand that Revit was designed natively to discourage this sorta thing but it is necessary in this case. I need to be able to place a single view with the elements in that view zoomed to fit the sheet.
So far the only idea I have had is to get the two farthest points in the element list and scale based on that distance. I would greatly appreciate any ideas or solutions anyone has even if it is not coding related. I'm sure this has came up throughout the years.
Disclaimer: I very well could be missing something obvious in which case also please feel free to tell me so.