This one should do the job.
Sub Main()
'check
If ThisDoc.Document.DocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then Exit Sub
'Current Drawing Document
Dim oDrawDoc As DrawingDocument = ThisDoc.Document
'Active sheet
Dim oSheet As Sheet = oDrawDoc.ActiveSheet
'Drawing View
Dim oFirst_view As DrawingView = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Please select the main view, ESC to Cancel")
If oFirst_view Is Nothing Then Exit Sub
Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
'Adding a drawing sketch to the view
Dim oDrawingSketch As DrawingSketch = oFirst_view.Sketches.Add
oDrawingSketch.Edit
'View height
Dim oFWHeight As Double = oFirst_view.Height+2
'Points for secion line
Dim oPoints(1) As Point2d
oPoints(0) = oTG.CreatePoint2d(0, oFWHeight)
oPoints(1) = oTG.CreatePoint2d(0, -oFWHeight)
'Sketch line(vertical)
Dim oSketchLine As SketchLine = oDrawingSketch.SketchLines.AddByTwoPoints(oPoints(0), oPoints(1))
Call oDrawingSketch.GeometricConstraints.AddVertical(oSketchLine)
oDrawingSketch.ExitEdit
Dim oInsertionPoint As Point2d = oTG.CreatePoint2d((oFirst_view.Position.X+oFirst_view.Width+1),(oFirst_view.Position.Y))
Dim oSectionView As SectionDrawingView
oSectionView = oSheet.DrawingViews.AddSectionView(oFirst_view, oDrawingSketch, oInsertionPoint, DrawingViewStyleEnum.kHiddenLineRemovedDrawingViewStyle)
oSectionView.ReverseDirection
'Getting the section name from Work Plane
'Referenced Document
Dim oRDoc As Document = oFirst_view.ReferencedDocumentDescriptor.ReferencedDocument
ThisApplication.Documents.Open(oRDoc.FullDocumentName, True)
'Getting the WorkPlane Name
Dim oWP As WorkPlane = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kWorkPlaneFilter, "Please select the Work Plane, ESC to Cancel")
If Not oWP Is Nothing Then oSectionView.Name = oWP.Name
oDrawDoc.Activate
End Sub