2020 Method
Changes 0
M

View3D.CreateIsometric

Description:
Returns a new isometric View3D.
Remarks:
The new View3D will receive a unique view name. The view will be oriented in the same position as the default 3D view.
public static View3D CreateIsometric(
	Document document,
	ElementId viewFamilyTypeId
)
Return Value View3D The new isometric View3D.
' Find a 3D view type
Dim collector1 As New FilteredElementCollector(document)
collector1 = collector1.OfClass(GetType(ViewFamilyType))
Dim viewFamilyTypes As IEnumerable(Of ViewFamilyType)

viewFamilyTypes = From elem In collector1 _
                  Let vftype = TryCast(elem, ViewFamilyType) _
                  Where vftype.ViewFamily = ViewFamily.ThreeDimensional _
                  Select vftype
' Create a new View3D
Dim view3D__1 As View3D = View3D.CreateIsometric(document, viewFamilyTypes.First().Id)
If view3D__1 IsNot Nothing Then
    ' By default, the 3D view uses a default orientation.
    ' Change the orientation by creating and setting a ViewOrientation3D
    Dim eye As New XYZ(10, 10, 10)
    Dim up As New XYZ(0, 1, 1)
    Dim forward As New XYZ(0, 1, -1)
    Dim viewOrientation3D As New ViewOrientation3D(eye, up, forward)
    view3D__1.SetOrientation(viewOrientation3D)
End If