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: 

Getting iAssembly Name using Inventor API

5 REPLIES 5
Reply
Message 1 of 6
ilyas_adnm
172 Views, 5 Replies

Getting iAssembly Name using Inventor API

Hi Everyone,

 

I'm trying to export BOM using iLogic, but when it comes to iAssemblies, it exports the QTY's for all the iAssembly members. I'm trying to define the BOMView iAssembly member like so:

 

 

Dim oDocument As AssemblyDocument = ThisApplication.ActiveDocument
Logger.Trace(oDocument.ComponentDefinition.iAssemblyMember.Row.MemberName)
Dim oBOMView As BOMView = oDocument.ComponentDefinition.BOM.BOMViews.Item("Structured")
If Not oDocument.ComponentDefinition.iAssemblyMember Is Nothing Then oBOMView.iAssemblyMemberName= oDocument.ComponentDefinition.iAssemblyMember.Row.MemberName
oBOMView.Export("C:\Users\Ilyas\Desktop\test.xlsx", kMicrosoftExcelFormat)

 

 

But I'm not able to get the iAssembly name. Does anyone know the trick?

 

Regards

Ilyas 

 

Labels (2)
5 REPLIES 5
Message 2 of 6
ilyas_adnm
in reply to: ilyas_adnm

I managed to get the active iAssembly name via:

 

oDocument.ComponentDefinition.iAssemblyFactory.DefaultRow.MemberName

 

However, it didn't really help with the final BOM export. Is there an option in the Export to use a specific iAssembly member?

Message 3 of 6
A.Acheson
in reply to: ilyas_adnm

Hi @ilyas_adnm 

 

Place the iassembly member into an assembly and export the bom from there. Or maybe you could try opening the member document manually and see if the bom is available for export. If it is then replicate by code. 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 4 of 6
ilyas_adnm
in reply to: ilyas_adnm

Hi @A.Acheson,

 

Thank for the suggestions. I would consider these as a possible workaround for getting the particular iAssemblyMember BOM.

 

But the thing is, I already have a script that does a few things before and after it exports, the BOM. I'm hoping to minimize the change to the existing code and see if I can just tweak the export function to get the active iAssemblyMember. 

 

Regards

Ilyas

Message 5 of 6
A.Acheson
in reply to: ilyas_adnm

Can you get the correct bom to export manually from within the factory file?

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 6 of 6
ilyas_adnm
in reply to: ilyas_adnm

Hi @A.Acheson,

 

Yes, if I export using the Export BOM icon in the BOM window, it only exports the active iAssemblyMember QTY column only.

 

export bom.png

Regards

Ilyas

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report