how to generate an array representing the projection of a multileaf collimator (MLC) field onto a CT slice in 3D Slicer?

I am trying to create an array with the same dimensions as a CT slice. Within this array, each voxel will have a value of 1 if it falls inside the MLC field and 0 if it falls outside.

Is this achievable using 3D Slicer?

I think we are already beyond this. @Mik has implemented support for beams with MLC in SlicerRT extension. I would recommend you to check out SlicerRT extension and come back here with any questions that yo may have.