The main issue here is that with a planar surface, you are never sure of the orientation of the X and Y axes of the surface’s plane. So, it’s it perfectly possible to determine the angle between the plane surface’s normal and the World Z vector and rotate the surface so its normal is parallel to world Z, but I don’t know how the other axes will be oriented…
Here is a quick sketch in Python:
import rhinoscriptsyntax as rs
import scriptcontext as sc
def plSrf_filt(rhino_object, geometry, component_index):
msg="Select planar surfaces to rotate"
if not srf_ids: return
for srf_id in srf_ids: