Getting iAssembly Name using Inventor API

Getting iAssembly Name using Inventor API

ilyas_adnm
Advocate Advocate
390 Views
5 Replies
Message 1 of 6

Getting iAssembly Name using Inventor API

ilyas_adnm
Advocate
Advocate

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 

 

0 Likes
391 Views
5 Replies
Replies (5)
Message 2 of 6

ilyas_adnm
Advocate
Advocate

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?

0 Likes
Message 3 of 6

A.Acheson
Mentor
Mentor

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
0 Likes
Message 4 of 6

ilyas_adnm
Advocate
Advocate

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

0 Likes
Message 5 of 6

A.Acheson
Mentor
Mentor

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
0 Likes
Message 6 of 6

ilyas_adnm
Advocate
Advocate

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

0 Likes