Solid Edge Assembly Type Library
Add Method
Name of Assembly Document for which the IAC is created
If not specified, then straight AssemblyCopy(or IAC) feature is created. If specified then it will be used to mirror about the plane. The Mirror Plane is either Top(XY), Right(YZ), Front(XZ) base plane in the assembly where the IAC is created.
Include Assembly features as Boolean. Default is True
Add new components on update as Boolean. Default is True
Number of specified components.
Array of specified components.
Coordinate system. If not specified, Base coordinate system will be used.
Description
Add specific components using Insert Assembly Copy.
Syntax
Visual Basic
Public Function Add( _
   ByVal FileName As String, _
   ByVal SpecifiedComponentSelection As AssemblyCopyComponentConstants, _
   Optional ByVal MirrorPlane As Variant, _
   Optional ByVal IncludeAF As Variant, _
   Optional ByVal AddNewComponentsOnUpdate As Variant, _
   Optional ByVal NumSpecifiedComponents As Variant, _
   Optional ByVal SpecifiedComponents As Variant, _
   Optional ByVal CoordinateSystem As Variant _
) As AssemblyCopy
Parameters
FileName
Name of Assembly Document for which the IAC is created
SpecifiedComponentSelection
ValueDescription
seAssemblyCopyComponentsExcludeAll
seAssemblyCopyComponentsExcludeSpecified
seAssemblyCopyComponentsIncludeAll
seAssemblyCopyComponentsIncludeSpecified
MirrorPlane
If not specified, then straight AssemblyCopy(or IAC) feature is created. If specified then it will be used to mirror about the plane. The Mirror Plane is either Top(XY), Right(YZ), Front(XZ) base plane in the assembly where the IAC is created.
IncludeAF
Include Assembly features as Boolean. Default is True
AddNewComponentsOnUpdate
Add new components on update as Boolean. Default is True
NumSpecifiedComponents
Number of specified components.
SpecifiedComponents
Array of specified components.
CoordinateSystem
Coordinate system. If not specified, Base coordinate system will be used.
Example
Imports System.Runtime.InteropServices
Public Class AddIACMirror

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim objApplication As SolidEdgeFramework.Application = Nothing
        Dim objAsmDoc As SolidEdgeAssembly.AssemblyDocument = Nothing
        Dim objIACDoc As SolidEdgeFramework.SolidEdgeDocument = Nothing
        Dim objAsmCopies As SolidEdgeAssembly.AssemblyCopies = Nothing
        Dim objAsmCopy1 As SolidEdgeAssembly.AssemblyCopy = Nothing
        Dim objAsmCopy2 As SolidEdgeAssembly.AssemblyCopy = Nothing
        Dim objAsmCopy3 As SolidEdgeAssembly.AssemblyCopy = Nothing
        Dim objAsmCopy4 As SolidEdgeAssembly.AssemblyCopy = Nothing

        Dim numComp As Long
        Dim specComponents As Array = Array.CreateInstance(GetType(System.Object), 2)

        Dim eType As SolidEdgeAssembly.AssemblyCopyTypeConstants = Nothing
        Dim objType As Type = Nothing

        Dim strLocalFileName As String = "C:\TestFiles\IACMirror\Blocks\Top.asm"
        Dim strLocalIACName As String = "C:\TestFiles\IACMirror\Blocks\BlockAB.asm"

        Try
            ' Create/get the application with specific settings
            objApplication = Marshal.GetActiveObject("SolidEdge.Application")

            If objApplication Is Nothing Then
                ' Get the type from the Solid Edge ProgID
                objType = Type.GetTypeFromProgID("SolidEdge.Application")
                ' Start Solid Edge
                objApplication = Activator.CreateInstance(objType)
                ' Make Solid Edge visible
                objApplication.Visible = True
            End If

            objAsmDoc = objApplication.Documents.Open(strLocalFileName)

            'open the IAC document
            objIACDoc = objApplication.Documents.Open(strLocalIACName)
            specComponents(0) = objIACDoc.Occurrences.Item(1)
            specComponents(1) = objIACDoc.Occurrences.Item(2)
            numComp = 2

            'Get assembly Copies
            objAsmCopies = objAsmDoc.AssemblyCopies
            'Mirror Plane is optional argument. If you dont need mirror copy then dont provide mirrorplane
            objAsmCopy1 = objAsmCopies.Add(strLocalIACName,
                                          SolidEdgeAssembly.AssemblyCopyComponentConstants.seAssemblyCopyComponentsIncludeAll,
                                          MirrorPlane:=objAsmDoc.AsmRefPlanes.Item(1))
            If (objAsmCopy1 Is Nothing) Then
                MsgBox("Could not create IAC with IncludeAll option !")
            End If


            objAsmCopy2 = objAsmCopies.Add(strLocalIACName,
                                           SolidEdgeAssembly.AssemblyCopyComponentConstants.seAssemblyCopyComponentsExcludeAll,
                                           MirrorPlane:=objAsmDoc.AsmRefPlanes.Item(1))
            If (objAsmCopy2 Is Nothing) Then
                MsgBox("Could not create IAC with ExcludeAll option !")
            End If


            objAsmCopy3 = objAsmCopies.Add(FileName:=strLocalIACName,
                                           SpecifiedComponentSelection:=SolidEdgeAssembly.AssemblyCopyComponentConstants.seAssemblyCopyComponentsIncludeSpecified,
                                           NumSpecifiedComponents:=numComp,
                                          SpecifiedComponents:=specComponents,
                                          IncludeAF:=False,
                                          AddNewComponentsOnUpdate:=False,
                                          CoordinateSystem:=objAsmDoc.CoordinateSystems.Item(2),
                                          MirrorPlane:=objAsmDoc.AsmRefPlanes.Item(2))
            If (objAsmCopy3 Is Nothing) Then
                MsgBox("Could not create IAC with seAssemblyCopyComponentsIncludeSpecified option !")
            End If

            objAsmCopy4 = objAsmCopies.Add(FileName:=strLocalIACName,
                                           SpecifiedComponentSelection:=SolidEdgeAssembly.AssemblyCopyComponentConstants.seAssemblyCopyComponentsExcludeSpecified,
                                           NumSpecifiedComponents:=1,
                                           CoordinateSystem:=objAsmDoc.CoordinateSystems.Item(2),
                                           SpecifiedComponents:=specComponents,
                                           MirrorPlane:=objAsmDoc.AsmRefPlanes.Item(1))
            If (objAsmCopy4 Is Nothing) Then
                MsgBox("Could not create IAC with seAssemblyCopyComponentsExcludeSpecified option !")
            End If

            'close documents
            objAsmCopy4 = Nothing
            objAsmCopy3 = Nothing
            objAsmCopy1 = Nothing
            objAsmCopy2 = Nothing
            objAsmCopies = Nothing

            objIACDoc.Close(SaveChanges:=False)
            objIACDoc = Nothing


        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try


    End Sub
End Class
See Also

AssemblyCopies Collection  | AssemblyCopies Members