Solid Edge Geometry Type Library
CreateCollection Method
Specifies the type of collection to be created. Valid values are members of the TopologyCollectionTypeConstants constant set.
Specifies the number of objects to be added to the collection.
Contains the topological elements to be added to the collection.
Description
Creates a collection of topological elements: edges, faces, or vertices.
Syntax
Visual Basic
Public Function CreateCollection( _
   ByVal Type As TopologyCollectionTypeConstants, _
   Optional ByVal NumberOfObjects As Variant, _
   Optional ByVal ObjectArray As Variant _
) As Object
Parameters
Type
ValueDescription
seEdgeCollectionTopology Collection Type - Edges
seFaceCollectionTopology Collection Type - Faces
seVertexCollectionTopology Collection Type - Vertices
Specifies the type of collection to be created. Valid values are members of the TopologyCollectionTypeConstants constant set.
NumberOfObjects
Specifies the number of objects to be added to the collection.
ObjectArray
Contains the topological elements to be added to the collection.
Example
Private Sub Form_Load()
    Dim objApp As SolidEdgeFramework.Application
    Dim objDoc As SolidEdgePart.PartDocument
    Dim objModel As SolidEdgePart.Model
    Dim objBody As SolidEdgeGeometry.Body
    Dim objEdgesCol As Object
    Dim objEdges As Object
    Dim objEdgeSets(1 To 2) As Object
    Dim objRound As SolidEdgePart.Round
    Const TESTFILE = "T:\vbtests\testcases\cube.par"
    Dim dblRadiusArray(1 To 2) As Double
    ' Report errors
    Const PI = 3.14159265358979
    ' Create/get the application with specific settings
    On Error Resume Next
    Set objApp = GetObject(, "SolidEdge.Application")
    If Err Then
        Err.Clear
        Set objApp = CreateObject("SolidEdge.Application")
        Set objDoc = objApp.Documents.Add("SolidEdge.PartDocument")
        objApp.Visible = True
    Else
        Set objDoc = objApp.ActiveDocument
    End If
    On Error GoTo 0
    ' Close active document if any
    Call objDoc.Close
    ' Open a testcase file
    Set objDoc = objApp.Documents.Open(TESTFILE)
    ' Get the body object of the model
    Set objModel = objDoc.Models(1)
    Set objBody = objModel.Body
    'Create an Empty EdgeCollection
    Set objEdgesCol = objBody.CreateCollection(Type:=seEdgeCollection)
    'Get the collection object of edges from the Body object
    Set objEdges = objBody.Edges(EdgeType:=igQueryAll)
    'Add few Edges into the collection
    Call objEdgesCol.Add(objEdges(1))
    Call objEdgesCol.Add(objEdges(3))
    'Create a round with the collection
    Set objEdgeSets(1) = objEdgesCol
    dblRadiusArray(1) = 0.005
    Set objRound = objModel.Rounds.Add(NumberOfEdgeSets:=1, EdgeSetArray:=objEdgeSets, _
                                       RadiusArray:=dblRadiusArray)
    ' USER DISPLAY
    ' Release objects
    Set objApp = Nothing
    Set objDoc = Nothing
    Set objBody = Nothing
    Set objEdgesCol = Nothing
End Sub
See Also

Body Object  | Body Members

Send comments on this topic.