You could do something brute-force like the following. Set the views
yourself and check the variable manually to populate your If...Then (If you
want the function to work when someone chooses their view relative to the
UCS, you'd need to add another flag to the sub). The 'eq' function is just
to get past the computer's exactness. This is a non-working example.
Good luck,
James
Function WhichViewActive() as string
dim varViewDir as variant
varViewDir = getVariable("VIEWDIR")
Dim varVD_WCS As Variant 'view direction vector, translated from UCS to
WCS
varVD_WCS = ThisDrawing.Utility.TranslateCoordinates(varVD, acUCS,
acWorld, True)
vX = varVD_WCS (0)
vY = varVD_WCS (1)
vZ = varVD_WCS (2)
if EQ(vX,0,0.01) and EQ(vY,0,0.01) and EQ(vZ,-1,0.01) then
WhichViewActive = "TOP"
elseif EQ(vX,0,0.01) and ...
WhichViewActive = ...
else
WhichViewActive = "UNKNOWN"
endif
End Function
Public Function eq(val1 As Double, val2 As Double, fuzz As Double) As
Boolean
'function courtesy of www.acadx.com
eq = Abs(val1 - val2) <= fuzz
End Function