Ilogic to add custom iproperty columns to bill of materials in assemblies

Ilogic to add custom iproperty columns to bill of materials in assemblies

BrandonW9
Advocate Advocate
3,239 Views
5 Replies
Message 1 of 6

Ilogic to add custom iproperty columns to bill of materials in assemblies

BrandonW9
Advocate
Advocate

Howdy... i'm just wondering if i can use ilogic to "Add custom iProperty columns" to the bill of materials.

 

The screenshot attached clarifies the function i'm talking about.

0 Likes
Accepted solutions (1)
3,240 Views
5 Replies
Replies (5)
Message 2 of 6

Curtis_Waguespack
Consultant
Consultant

Hi BrandonW9,

 

This would be something done through iLogic using the API.

 

See this link:

https://forums.autodesk.com/t5/inventor-customization/add-custom-iproperty-to-bom-using-api/m-p/3278...

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

EESignature

0 Likes
Message 3 of 6

MechMachineMan
Advisor
Advisor
Accepted solution

I don't think so.

 

But you can add them to one file, set the appearance of the BOM how you like it by dragging files, then export that customization to an xml file. Then you can use a rule like the following to import that into whatever assembly you want, and it will have those rows exposed, and be ordered to look like the customization file:

 

Sub Main()

	Dim oADoc As Document
	oADoc = ThisApplication.ActiveDocument
	
	Dim oDoc As AssemblyDocument
	
	If oADoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject
		oDoc = oADoc
	Else If oADoc.DocumentType = DocumentTypeEnum.kDrawingDocumentObject
		Try
			oDoc = oADoc.ActiveSheet.DrawingViews.Item(1).ReferencedDocumentDescriptor.ReferencedDocument
		Catch
			MsgBox("LOD in use in drawing; Macro failed!")
		End Try
	Else
		MsgBox("Invalid Document!")
	End If

	
	Dim oBOM As BOM
	oBOM = oDoc.ComponentDefinition.BOM

	
	oBOM.ImportBOMCustomization("Z:\BOM_Style.xml")
	
	oBOM.StructuredViewEnabled = True
	oBOM.StructuredViewFirstLevelOnly = False
	
	oBOM.PartsOnlyViewEnabled = True

End Sub

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
Message 4 of 6

quangnguyen2FWX7
Participant
Participant
Tks you save my time.
0 Likes
Message 5 of 6

blandb
Mentor
Mentor

Are these fields going to be there ALL the time? If so, why not open the assembly template, add them to the Bill of Materials, then if that fields needs to be filled out and you fill it out in the Bill of materials for a specific part, and those fields dont exist, when you hit save, it automatically adds them. You could also add them to the part templates custom iproperties, so every time you start a new part they are there.  Just a thought.

Autodesk Certified Professional
Message 6 of 6

drivasLL7NN
Explorer
Explorer

Muchas gracias, este aporte es muy bueno!!!!!

 

Me sirvio para una implementación que estoy haciendo en mi trabajo

 

 

0 Likes