Disable "Merge rows on part number match" using iLogic

Disable "Merge rows on part number match" using iLogic

CDuPlessisTQEZQ
Enthusiast Enthusiast
103 Views
2 Replies
Message 1 of 3

Disable "Merge rows on part number match" using iLogic

CDuPlessisTQEZQ
Enthusiast
Enthusiast

Good day everyone.

 

I wish to disable the "Merge Rows on Part Number Match" inside the Bill of materials when I have an Assembly open.

CDuPlessisTQEZQ_0-1752486393888.png

 

Now, I don't want to disable this manually every single time I open a new or existing assembly.

I'm creating something else in iLogic for exporting an assemblies BOM in a way that I want it to be exported and this is one of the settings I want disabled when the code is running.

 

I've checked out a bunch of articles but can't find anything on a snipped of code that just disables this setting.

Does it even exist?

 

(I'm no programmer, I just have a general jist of coding and that's it. I use snippets and try understanding what I'm doing)

 

My Inventor is 2023 currently. Will be updating to 2025 in a few months.

 

Here's the code I'm also working (WIP):

 

' To check if current open document (Active document) is an assembly. (.iam) - Returns a 'true' or 'false' value.
IsAssembly = ThisApplication.ActiveDocument.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject

' If is .iam then make changes to the BOM Structure.
If IsAssembly = True Then
	Dim AssyDoc As AssemblyDocument = ThisApplication.ActiveDocument
	Dim AssyBom As BOM = AssyDoc.ComponentDefinition.BOM
	AssyBom.StructuredViewEnabled = True
	AssyBom.StructuredViewFirstLevelOnly = False
	AssyBom.StructuredViewDelimiter = "."
	AssyBom.HideSuppressedComponentsInBOM = True
	AssyBom.RenumberItemsSequentially = True
	'AssyBom.MergePartNumbers = False  -  (<- this is not working)

	
Else
	MessageBox.Show("Active document is NOT an assembly.", "BOM Check")
End If
	

 

0 Likes
Accepted solutions (1)
104 Views
2 Replies
Replies (2)
Message 2 of 3

g.georgiades
Advocate
Advocate
Accepted solution

Have a look at the BOM API docs. You have to use a method to set the part number merge settings

https://help.autodesk.com/view/INVNTOR/2025/ENU/?guid=GUID-BOM

 

ie

AssyBom.SetPartNumberMergeSettings2(false)
AssyBom.SetPartNumberMergeSettings2(true, {"a", "ab", "c"}, true)
AssyBom.SetPartNumberMergeSettings2(True, Nothing, False)

 

ggeorgiades_0-1752492021742.png

 

0 Likes
Message 3 of 3

CDuPlessisTQEZQ
Enthusiast
Enthusiast

All these worked...

Wow, I'll save that website now and try and understand what's going on. Thank you for your help. I appreciate it! XD

0 Likes