Solid Edge Part Type Library
Add Method
Specifies the number of parent faces.
Specifies the Face objects with which to create the CopySurface object.
Specifies whether to copy or remove internal boundaries when the CopySurface object is created. Valid values are members of the CopySurfaceInternalBoundaryConstants constant set.
Specifies whether to copy or remove external boundaries when the CopySurface object is created. Valid values are members of the CopySurfaceExternalBoundaryConstants constant set.
Description
Adds an occurrence of the referenced object.
Syntax
Visual Basic
Public Function Add( _
   ByVal NumberOfFaces As Long, _
   ByRef FaceArray() As Object, _
   Optional ByVal InternalBoundary As Variant, _
   Optional ByVal ExternalBoundary As Variant _
) As CopySurface
Parameters
NumberOfFaces
Specifies the number of parent faces.
FaceArray
Specifies the Face objects with which to create the CopySurface object.
InternalBoundary
Specifies whether to copy or remove internal boundaries when the CopySurface object is created. Valid values are members of the CopySurfaceInternalBoundaryConstants constant set.
ExternalBoundary
Specifies whether to copy or remove external boundaries when the CopySurface object is created. Valid values are members of the CopySurfaceExternalBoundaryConstants constant set.
Example
Imports System.IO
Imports System.Runtime.InteropServices
Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim objSEApplication As SolidEdgeFramework.Application = Nothing
        Dim objPartDoc As SolidEdgePart.PartDocument = Nothing
        Dim objModels As SolidEdgePart.Models = Nothing
        Dim objModel As SolidEdgePart.Model = Nothing
        Dim i As Integer
        Dim objConstructions As SolidEdgePart.Constructions = Nothing
        Dim objBody As SolidEdgeGeometry.Body = Nothing
        Dim objFaces As SolidEdgeGeometry.Faces = Nothing
        Dim objFace() As SolidEdgeGeometry.Face = Nothing
        ReDim objFace(1)
        Dim SEInstallDir As DirectoryInfo
        Dim objCopySurfaces As SolidEdgePart.CopySurfaces = Nothing
        Dim objCopySurface As SolidEdgePart.CopySurface = Nothing
        Try
            objSEApplication = Marshal.GetActiveObject("SolidEdge.Application")
            SEInstallDir = GetTrainingFolder()
            objPartDoc = objSEApplication.Documents.Open(SEInstallDir.FullName + "\anchor.par")
            objModels = objPartDoc.Models

            For i = 1 To objModels.Count
                objModel = objModels.Item(i)
                objBody = objModel.Body
                objFaces = objBody.Faces(SolidEdgeGeometry.FeatureTopologyQueryTypeConstants.igQueryPlane)
                objFace(0) = objFaces.Item(1)

                objConstructions = objPartDoc.Constructions
                objCopySurfaces = objConstructions.CopySurfaces
                objCopySurface = objCopySurfaces.Add(1, objFace)
            Next


        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End Sub
    Function GetTrainingFolder() As DirectoryInfo
        Dim objInstallData As SEInstallDataLib.SEInstallData = Nothing
        Dim objInstallFolder As DirectoryInfo = Nothing
        Dim objTrainingFolder As DirectoryInfo = Nothing

        Try
            objInstallData = New SEInstallDataLib.SEInstallData
            objInstallFolder = New DirectoryInfo(objInstallData.GetInstalledPath())
            objTrainingFolder = New DirectoryInfo(Path.Combine(objInstallFolder.Parent.FullName, "Training"))
        Catch
        Finally
            If Not (objInstallData Is Nothing) Then
                Marshal.FinalReleaseComObject(objInstallData)
                objInstallData = Nothing
            End If
        End Try

        Return objTrainingFolder
    End Function

End Class
See Also

CopySurfaces Collection  | CopySurfaces Members