Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Part Number Row Merge

donaldleigh
Advocate

Part Number Row Merge

donaldleigh
Advocate
Advocate

Hi Guys

 

I have created the below rule (slowly getting this coding) and it works by added a part number to the "Merge Exclude List". What I cant work out now is how to add several numbers to this list. I can only have it enter 1 at a time. I need to add approx 200 via an array but I cant got it to work.

once I have this I would like to have the list read from an excel spreadsheet.

 

Cheers

Donald

 

SyntaxEditor Code Snippet

Dim oDoc As Document
oDoc = ThisDoc.Document
Dim oCD As AssemblyComponentDefinition
Dim oList As String
oList = "11111"
oCD = oDoc.ComponentDefinition
oBOM = oCD.BOM
oBOM.SetPartNumberMergeSettings(True,{oList})

 

0 Likes
Reply
460 Views
3 Replies
Replies (3)

chandra.shekar.g
Autodesk Support
Autodesk Support

@donaldleigh,

 

Hoping that below iLogic code may help to set merge for more that one value.

Dim oDoc As Document
oDoc = ThisDoc.Document
Dim oCD As AssemblyComponentDefinition
Dim array(3) As String
array(0) = "11111"
array(1) = "22222"
array(2) = "33333"
oCD = oDoc.ComponentDefinition
oBOM = oCD.BOM
oBOM.SetPartNumberMergeSettings(True, array)

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes

donaldleigh
Advocate
Advocate

Hi Chandra

when I tried your code I get the attached error.

Also is there a way to pull these part numbers from Excel?

 

Donald

0 Likes

chandra.shekar.g
Autodesk Support
Autodesk Support

@donaldleigh,

 

Same suggestion is given in the below forum discussion.

 

https://forums.autodesk.com/t5/inventor-engineer-to-order/get-setpartnumbermergesettings/td-p/522421...

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes