Thanks Clusta.
I am using iLogic to suppress parts/assemblies, create custom ilogic parts, and changing members in iPart/iAssemblies. The method I was originally using to locate parts/assemblies in the model was to first “Normalize” the name in the assembly Browser. This allowed the code to search for a static name in the assembly. However our document management software does not allow that. It syncs the Bowser Name to a concatenation of the Part number and Description. So now I am searching be location in the Browser (My_Variable#) to get the parts Browser Name:
My_Variable3 = ThisDoc.Document.ComponentDefinition.Occurrences.Item(3).Name
If(Parameter("AIR_INLET") = "3 OCLOCK" Or Parameter("AIR_INLET") = "6 OCLOCK")
i = iPart.FindRow(My_Variable3, "Part Number", "=", 101034182)
Parameter("GAS_VALVE_POSITION") = 0
Else
i = iPart.FindRow(My_Variable3, "Part Number", "=", 101034183)
Parameter("GAS_VALVE_POSITION") = 180
End If
The problem is the Browser list somehow became static (now out of order). I may have used the "Alpha Sort Component" located in the Productivity Tab in the past. Not the ideal fix, but I demoted all the parts to a new assembly and not the Browser list order is correct.
When I ran your second code in the model with the "Browser Order Issue" I received the follow error:
The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)). In another model that is working fine I do not receive an error. Not sure why it behaves that way.