About Splitting the Active Viewport (VBA/ActiveX)

The active viewport can be split into multiple viewports using the Split method.

This method takes one parameter, the type of configuration to split the viewport into. To specify the window configuration, use one of the following constants that correspond to the default configurations previously shown: acViewport2Horizontal, acViewport2Vertical, acViewport3Left, acViewport3Right, acViewport3Horizontal, acViewport3Vertical, acViewport3Above, acViewport3Below, or acViewport4.

Split a viewport into two horizontal windows

The following example creates a new viewport and then splits the viewport into two horizontal windows.

Sub Ch3_SplitAViewport()
  ' Create a new viewport
  Dim vportObj As AcadViewport
  Set vportObj = ThisDrawing.Viewports.Add("TEST_VIEWPORT")

  ' Split vportObj into 2 horizontal windows
  vportObj.Split acViewport2Horizontal

  ' Now set vportObj to be the active viewport
  ThisDrawing.ActiveViewport = vportObj
End Sub