You may be able to get this routine I use to work for you (but I won't be sharing my FeetInchToDecimalInch conversion tool):
Public Sub ReduceScaleToFit(ByRef view As DrawingView, ByRef strStartScale As String, Optional ByRef maxWidthInch As Double = Nothing, Optional ByRef maxHeightInch As Double = Nothing)
Dim dwgDoc As Inventor.DrawingDocument = view.Parent.Parent
Dim scales() As String = dwgDoc.StylesManager.ActiveStandardStyle.PresetScales
Dim booScaleFound As Boolean = False
If maxWidthInch <> Nothing Then
If view.Width > maxWidthInch * 2.54 Then
Dim modWidth As Double = view.Width / view.Scale / 2.54
booScaleFound = False
For i As Integer = scales.Count - 1 To 0 Step -1
Dim strSplit() As String = scales(i).Split("=")
Dim top As Double = FeetInchToDecimalInch(strSplit(0))
Dim bot As Double = FeetInchToDecimalInch(strSplit(1))
If top / bot * modWidth < maxWidthInch Then
strStartScale = scales(i)
booScaleFound = True
Exit For
End If
Next
If booScaleFound = False Then
'force a scale to fit view on page
Dim intBottom As Integer = CInt((modWidth / maxWidthInch) + 1)
strStartScale = "1/" & intBottom.ToString
End If
End If
End If
view.ScaleString = strStartScale 'set the width scale first, and then check if it is too tall second.
If maxHeightInch <> Nothing Then
If view.Height > maxHeightInch * 2.54 Then
Dim modHeight As Double = view.Height / view.Scale / 2.54
booScaleFound = False
For i As Integer = scales.Count - 1 To 0 Step -1
Dim strsplit() As String = scales(i).Split("=")
Dim top As Double = FeetInchToDecimalInch(strsplit(0))
Dim bot As Double = FeetInchToDecimalInch(strsplit(1))
If top / bot * modHeight < maxHeightInch Then
strStartScale = scales(i)
booScaleFound = True
Exit For
End If
Next
If booScaleFound = False Then
'force a scale to fit view on page
Dim intBottom As Integer = CInt((modHeight / maxHeightInch) + 1)
strStartScale = "1/" & intBottom.ToString
End If
End If
End If
view.ScaleString = strStartScale
If booScaleFound = False Then
view.ShowScale = True
view.ShowName = True
view.ShowLabel = True
End If
End Sub
So I use this routine to verify if the view is within a set of space limits (inch math on our drawings so you see conversion from centimeter to inch a lot). The FeetInch converter simply understands that 1'-0 1/4" = 12.25, but mine is custom built for the company and very complex. This program reads the scales in the document and only uses them, but you can actually use ANY scale ratio you want.
Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/