How to define a variable as an Array (or int, bool etc.) in Design Script

revit

#1

I am curious how I can define what my type my variables are when creating a Design Script function. Below is the Code I’m trying to generate as a function:

def processAndUpdateBathroomReqData(womensRoomsAndReq, mensRoomsAndReq)
{
/* Get Womens Values */
getWomensRooms = List.GetItemAtIndex(womensRoomsAndReq, 0);
getWomensValues = List.GetItemAtIndex(womensRoomsAndReq, 1);
transposedWomensValues = List.Transpose(getWomensValues);
womensValues1 = List.GetItemAtIndex(transposedWomensValues,0);
womensValues2 = List.GetItemAtIndex(transposedWomensValues,1);

/* Get Mens Values */
getMensRooms = List.GetItemAtIndex(mensRoomsAndReq, 0);
getMensValues = List.GetItemAtIndex(mensRoomsAndReq, 1);
transposedMensValues = List.Transpose(getMensValues);
mensValues1 = List.GetItemAtIndex(transposedMensValues,0);
mensValues2 = List.GetItemAtIndex(transposedMensValues,1);
mensValues3 = List.GetItemAtIndex(transposedMensValues,2);

/* Get Parameters Names to Store Calculations */
param1 = List.GetItemAtIndex(requirementPrameterValues(), 0);
param2 = List.GetItemAtIndex(requirementPrameterValues(), 1);
param3 = List.GetItemAtIndex(requirementPrameterValues(), 2);

/* Update Women's Bathrooms with Requirement Data*/
updateWomensRooms1 = getWomensRooms.SetParameterByName(param1, womensValues1);
updateWomensRooms2 = getWomensRooms.SetParameterByName(param2, womensValues2);
updateWomensRooms3 = getWomensRooms.SetParameterByName(param3, 0);

/* Update Men's Bathrooms with Requirement Data*/
updateMensRooms1 = getMensRooms.SetParameterByName(param1, mensValues1);
updateMensRooms2 = getMensRooms.SetParameterByName(param2, mensValues2);
updateMensRooms3 = getMensRooms.SetParameterByName(param3, mensValues3);

};

I am able to call the function, but when I do I get the warning below: Converting an array to var would cause array rank reduction and is not permitted. Is there any way to modify the function to allow arrays as inputs?


#2

Try this…
def processAndUpdateBathroomReqData(womensRoomsAndReq:var[]..[], mensRoomsAndReq:var[]..[])


#3

@j.darling have you come across any update on this issue ?