Solid Edge Assembly Type Library > AssemblyDocument Object : GetContainerDocumentAndOccurrenceOfIPADoc Method |
Visual Basic |
---|
Public Sub GetContainerDocumentAndOccurrenceOfIPADoc( _ ByRef ContainerDocument As Object, _ ByRef IPAOccurrence As Object _ ) |
Open a top assembly document (topasm.asm) which has two sub-assembly occurrences (subasm1.asm:1) and subasm2.asm:1.
IPA into subasm1.asm:1 which has a part (Part1.par).
To get/set visible property on Part1.par, below are the steps:
Imports System.Runtime.InteropServices Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim objApp As SolidEdgeFramework.Application = Nothing Dim occN As Object Dim objDoc As SolidEdgeAssembly.AssemblyDocument = Nothing Dim occNDoc As Object Dim subocc As SolidEdgeAssembly.SubOccurrence = Nothing occN = Nothing occNDoc = Nothing subocc = Nothing Try objApp = Marshal.GetActiveObject("SolidEdge.Application") objDoc = objApp.ActiveDocument 'objDoc is the active document variable objDoc.GetContainerDocumentAndOccurrenceOfIPADoc(occNDoc, occN) 'OccNDoc is the topAsm.asm and occN is the occurrence subasm1.asm 'To get to Part1.par and set the visible property subocc = DirectCast(occN, SolidEdgeAssembly.Occurrence).SubOccurrences.Item(1) subocc.Visible = False MessageBox.Show("Visibility of " & subocc.Name & ": " & subocc.Visible.ToString()) 'Visibility should be false occN = Nothing occNDoc = Nothing subocc = Nothing Catch ex As Exception MsgBox(ex.ToString) End Try End Sub End Class