The python code is as follows:
# Import RevitNodes
fam = IN
vals = IN
#create empty lists for outputs
h = 
w = 
l = 
codes = 
#create scope of work for list of vals, defined at line 7.
for v in vals:
#sets the height, width, and length parameters based on the contents of the vals list, defined at line 7
#sets the code parameter value according to the vals list, which was defined at line 7.
#if your families have a method for defining the code already built in than you don't need to run the next two lines, and can comment them out by adding a # to the front of the line.
codeval = str(v) + "x" + str(v) + "x" + str(v)
#adds the Height value found at index 0 to the h list. Since this set the height it is the equivilent of getting the Height value.
#adds the Width value found at index 1 to the w list. Same idea as what we just did with the height.
#Same concept as what was done with H and W before.
#gets the code value from the family and appends it to the list of codes. This method was used instead of self defining it as was done for line 26 so that families which use formulas or other methods to define the code can work with the same python script.
code = fam.GetParameterValueByName('Code')
#defines the outputs, which is the family name, the list of heights, the list of widths, the list of lengths, and the list of codes with all results appended to the dataset.
OUT = [fam, h, w, l,codes]
You’ll need to make more than a few changes to make this work for you, but it should be doable thanks to the amount of notations I put in there.