Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Hybrid Configurator (iAssembly & Assembly)

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
gfunnybus
461 Views, 2 Replies

Hybrid Configurator (iAssembly & Assembly)

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:

 

http://forums.autodesk.com/t5/inventor-customization/can-iassembly-configuration-list-appear-in-an-i...

 

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)
2 REPLIES 2
Message 2 of 3
gfunnybus
in reply to: gfunnybus

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")
Message 3 of 3
MaheshwarMD
in reply to: gfunnybus

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

 

 

Mahesh

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report