Try this.
Code:
Sub GenSection()
Dim x3DSolid As Acad3DSolid
ThisDrawing.Utility.GetEntity x3DSolid, basePt, "Pick 3D Solid"
Dim PlaneVector(0 To 2) As Double
PlaneVector(0) = 0: PlaneVector(1) = 0: PlaneVector(2) = 1
pt1 = ThisDrawing.Utility.GetPoint(, "Pick first point")
pt2 = ThisDrawing.Utility.GetPoint(, "Pick end point")
Dim sec As AcadSection
Dim ss As AcadSectionSettings
Set sec = ThisDrawing.ModelSpace.AddSection(pt1, pt2, PlaneVector)
With sec
.TopHeight = 3
.BottomHeight = 1
.State = acSectionStatePlane
Set ss = .Settings
End With
With ss
.CurrentSectionType = acSectionType2dSection
End With
Dim acSectionTypeSettings As AcadSectionTypeSettings
Set acSectionTypeSettings = ss.GetSectionTypeSettings(acSectionType2dSection)
With acSectionTypeSettings
.ForegroundLinesVisible = True
.BackgroundLinesHiddenLine = True
.IntersectionFillHatchPatternName = "ANSI31"
'and other settings
End With
sec.GenerateSectionGeometry x3DSolid, BoundaryObjs, FillObjs, BakcGroundObjs, ForegroundObjs, CurveTangencyObjs
End Sub
BoundaryObjs receives the boundary lines, FillObjs receives the fills (hatch), and so on.
PS: use "[code]" tags