Solid Edge Assembly Type Library
AddVisible Property
Number of occurrences to exclude.
Occurrence to exclude as array.
0
Number of occurrences to include.
Occurrence to include as array.
Description
Adds a visible simplified assembly
Property type
Read-only property
Syntax
Visual Basic
Public Property AddVisible( _
   ByVal NumOccurrenceExclude As Long, _
   ByRef OccurrenceExclude() As Object, _
   ByVal dExcludeRangeRatio As Double, _
   ByVal NumOccurrenceInclude As Long, _
   ByRef OccurrenceInclude() As Object, _
   ByVal CopyType As VisibilityBasedSimplifiedAssemblyCopyType _
) As SimplifiedAssembly
Parameters
NumOccurrenceExclude
Number of occurrences to exclude.
OccurrenceExclude
Occurrence to exclude as array.
dExcludeRangeRatio
0
NumOccurrenceInclude
Number of occurrences to include.
OccurrenceInclude
Occurrence to include as array.
CopyType
ValueDescription
seVisibilityBasedSimplifiedAssemblyCopyTypeBodiesComplete body of visible faces are copied to the simplified assembly representation
seVisibilityBasedSimplifiedAssemblyCopyTypeFacesVisible faces are copied to the simplified assembly representation
Return Type
Returns a Simplified Assembly
Example
Imports System.Runtime.InteropServices
Public Class AddVisible

    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 objSimpls As SolidEdgeAssembly.SimplifiedAssemblies = Nothing
        Dim objSimpl As SolidEdgeAssembly.SimplifiedAssembly = Nothing
        Dim arrayExcludeOccs(0 To 4) As Object
        Dim arrayIncludeOccs(0 To 4) As Object
        Dim objType As Type = Nothing

        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
            'Get reference to active document
            objAsmDoc = objApplication.ActiveDocument
            'If assembly is simplified return the collection of simplified assemblies
            objSimpls = objAsmDoc.SimplifiedAssemblies
            'Get the first item in the collection
            objSimpl = objSimpls.Item(1)

            If objAsmDoc Is Nothing Then
                MsgBox("Could not open document ")
                'GoTo ErrorHandler
            End If

            'simplified asssembly testing
            arrayExcludeOccs(0) = objAsmDoc.Occurrences.Item(2)
            arrayExcludeOccs(1) = objAsmDoc.Occurrences.Item(4)
            arrayIncludeOccs(0) = objAsmDoc.Occurrences.Item(1)

            'Add Visible faces
            objSimpl = objSimpls.AddVisible(2, arrayExcludeOccs, 0, 1, arrayIncludeOccs, 0)

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

    End Sub
End Class
See Also

SimplifiedAssemblies Collection  | SimplifiedAssemblies Members

Send comments on this topic.