Hello,
I am looking to create a configurator that can control some sub-assemblies that are both normal assembly and iAssembly. The goal here being to get the row information from a component and populate an arraylist/multivalue parameter in order to drop it into a form for the user. I saw a similar post where a drawing file was used to strip the table info from a drawing view item. I am hoping to do this from the assembly level, but I lack the coding knowledge for calling an occurance(?) like this. Help greatly appreciated! Here is the post I found:
Here is what I am going for:
I tried:
oComps.Item(2).ParentFactory
oComps.Item(2).iAssemblyMember
oComps.Item(2).iAssemblyFactory
Dim oDoc As AssemblyDocument
oDoc = ThisDoc.Document
Dim oComps As ComponentOccurrences oComps = oDoc.ComponentDefinition.Occurrences
'Dim oArmAssembly As ?? perhaps oArmAssembly = oComps.Item(2) 'allows the part to be replaced more than once Dim HolderList As String Dim oRow As iPartTableRow For Each oRow In ArmAssembly.TableRows HolderList = HolderList & vbLf & oRow.MemberName Next MessageBox.Show(HolderList)
Solved! Go to Solution.
Solved by gfunnybus. Go to Solution.
This seems to work!
Dim oDoc As Document = ThisDoc.Document Dim oComp As ComponentOccurrence Dim oComps As ComponentOccurrences = oDoc.ComponentDefinition.Occurrences Dim oCompList As String For Each oComp In oComps oCompList = oCompList & vbLf & oComp.Name Next 'MessageBox.Show(oCompList, "Component List")oOcc = oComps.Item(2) 'MessageBox.Show(oOcc.Name, "Arm Assembly") If oOcc.IsiAssemblyMember = False Then MessageBox.Show("Not iAssembly Member", "iAssembly Test") Exit Sub Else 'MessageBox.Show("Is iAssembly Member", "iAssembly Test")End If Dim oAssyDoc As AssemblyDocument = oOcc.Definition.Document Dim oAssyDocDef As AssemblyComponentDefinition = oAssyDoc.ComponentDefinition Dim oFactory As iAssemblyFactory = oAssyDocDef.iAssemblyMember.ParentFactory Dim oTableRows As iAssemblyTableRows = oFactory.TableRows Dim HolderList As String For Each oRow As iAssemblyTableRow In oTableRows HolderList = HolderList & vbLf & oRow.MemberName Next MessageBox.Show(HolderList, "iAssembly Table List")
Hello,
I had tried this code, but when I run this code I am getting error message as oOcc is not declared.
Could you please upload the modified code