So the answer was in the tutorials for VBAPI in the pfcDrawingExample.vb
In the "Create drawing views" example it clearly shows what command to use.
'Create drawing views
'======================================================================
'Function : createSheetAndViews
'Purpose : This function adds a new sheet to a drawing and
' creates three views of input model.
'======================================================================
Public Sub createSheetAndViews(ByRef session As IpfcBaseSession, ByVal solidName As String)
Dim model As IpfcModel
Dim solidModel As IpfcModel
Dim drawing As IpfcDrawing
Dim sheetNo As Integer
Dim modelDesc As IpfcModelDescriptor
Dim matrix As CpfcMatrix3D
Dim i, j As Integer
Dim transF As IpfcTransform3D
Dim pointLoc As IpfcPoint3D
Dim genViewInstructions As IpfcGeneralViewCreateInstructions
Dim proViewInstructions As IpfcProjectionViewCreateInstructions
Dim view2D As IpfcView2D
Dim outline As CpfcOutline3D
Try
'======================================================================
'Get current model and check that it is a drawing
'======================================================================
model = session.CurrentModel
If model Is Nothing Then
Throw New Exception("Model not present")
End If
If Not model.Type = EpfcModelType.EpfcMDL_DRAWING Then
Throw New Exception("Model is not drawing")
End If
drawing = CType(model, IpfcDrawing)
'======================================================================
'Add new sheet to drawing
'======================================================================
sheetNo = drawing.AddSheet()
drawing.CurrentSheetNumber = sheetNo
'======================================================================
'Find the model in session or retrieve from disk
'======================================================================
modelDesc = (New CCpfcModelDescriptor).CreateFromFileName(solidName)
solidModel = session.GetModelFromDescr(modelDesc)
If solidModel Is Nothing Then
solidModel = session.RetrieveModel(modelDesc)
If solidModel Is Nothing Then
Throw New Exception("Unable to load Model " + solidName)
End If
End If
'======================================================================
'Add the model to drawing
'======================================================================
Try
drawing.AddModel(solidModel)
Catch ex As Exception
Throw New Exception("Unable to add Model " + solidName + " to drawing")
End Try
'======================================================================
'Create a general view from the Z axis direction at a predefined
'Location
'======================================================================
matrix = New CpfcMatrix3D
For i = 0 To 3
For j = 0 To 3
If i = j Then
matrix.Set(i, j, 1.0)
Else
matrix.Set(i, j, 0.0)
End If
Next
Next
transF = (New CCpfcTransform3D).Create(matrix)
pointLoc = New CpfcPoint3D
pointLoc.Set(0, 200.0)
pointLoc.Set(1, 600.0)
pointLoc.Set(2, 0.0)
genViewInstructions = (New CCpfcGeneralViewCreateInstructions). _
Create(solidModel, sheetNo, pointLoc, transF)
view2D = drawing.CreateView(genViewInstructions)
'======================================================================
'Get the position and size of the new view
'======================================================================
outline = view2D.Outline
'======================================================================
'Create a projected view to the right of the general view
'======================================================================
pointLoc.Set(0, outline.Item(1).Item(0) + (outline.Item(1).Item(0) _
- outline.Item(0).Item(0)))
pointLoc.Set(1, (outline.Item(0).Item(1) + outline.Item(1).Item(1)) / 2)
proViewInstructions = (New CCpfcProjectionViewCreateInstructions). _
Create(view2D, pointLoc)
drawing.CreateView(proViewInstructions)
'======================================================================
'Create a projected view bellow the general view
'======================================================================
pointLoc.Set(0, (outline.Item(0).Item(0) + outline.Item(1).Item(0)) / 2)
pointLoc.Set(1, outline.Item(0).Item(1) - (outline.Item(1).Item(1) _
- outline.Item(0).Item(1)))
proViewInstructions = (New CCpfcProjectionViewCreateInstructions). _
Create(view2D, pointLoc)
drawing.CreateView(proViewInstructions)
drawing.Regenerate()
Catch ex As Exception
MsgBox(ex.Message.ToString + Chr(13) + ex.StackTrace.ToString)
End Try
End Sub