The first thing you need to do when placing in an iassembly/iPart is to normalize the occurrence name(“Chasis:1”). See article here. Give it a standardized name such as “Chasis”. This is now your assembly references this component and can reach the file name. If you change the member this reference name remains the same even thou the filename will now be different. You will notice without this change that the occurrence name will change based on the member/filename and then your code has nothing to reference.
Next you can use iPart.findrow function to find a row in your table based on the parameters your looking for. See Help file here.
Once you find the row , then supply the row number to the ipart.change more function.
So this works much the same has how you manually select a row. Scan the table and find the matching parameters then change the row.
Dim Row as Integer = iPart.FindRow("Chasis", "Thread_Diameter", ">=", 0.45, "Thread_Length", ">=", 2.0)
iPart.ChangeRow("Chasis", Row)
For iAssembly switch iPart for iAssembly
Dim Row as Integer = iAssembly.FindRow("Chasis", "Thread_Diameter", ">=", 0.45, "Thread_Length", ">=", 2.0)
iAssembly.ChangeRow("Chasis", Row)
If this solved a problem, please click (accept) as solution.
Or if this helped you, please, click (like)
Regards
Alan