Sub CATMain()
' Retrieve the Sections collection
Dim cSections As Sections
Set cSections = CATIA.ActiveDocument.Product.GetTechnologicalObject("Sections")
' Create the master section
Dim oMasterSection As Object 'Section
Set oMasterSection = cSections.Add
' Retrieve data on master section
Dim Position(11)
oMasterSection.GetPosition Position
Dim dHeight As Double
dHeight = oMasterSection.Height
Dim dWidth As Double
dWidth = oMasterSection.Width
Dim dMin As Double
If (dWidth > dHeight) Then
dMin = dWeight
Else
dMin = dWidth
End If
' Remove the master section
cSections.Remove oMasterSection
Set oMasterSection = Nothing
' Create the network
Dim oSection As Object 'Section
Position(11) = 1
Do
' Create section and force type
Set oSection = cSections.Add
oSection.Type = catSectionTypePlane
' Modify position
Position(11) = Position(11) + 1
oSection.SetPosition Position
Indicator = oSection.IsEmpty
If Indicator = 0 Then
cSections.Remove oSection
Else
End If
Set oSection = Nothing
Loop Until Indicator = 0
Set cSections = Nothing
End Sub