4 direct shapes (1.rvt)
Assigning materials to 4 direct shapes through DY (1. Assign Materials.dyn)
Concrete - Grey to QL_2B3Pmy2&3Pmy3_SB_YST_01
Concrete - Purple to QL_2B3Pmy2&3Pmy3_SB_YST_02
Concrete - Green to QL_2B3Pmy2&3Pmy3_SB_YST_03
Concrete - Cyan to QL_2B3Pmy2&3Pmy3_SB_YST_04
Delete origins and you will see colored direct shapes (DY will make a copy and assign the material to the copy, not to the origins)
But if you open another 3d window in Revit, the color disappear.
Or use Element.GetMaterials in DY, yu will get empty list.
Looks to me the material assigned to direct shapes are just color in view, so they are not persistent.