Make2D of layout or detail?

How do I script Make2D of an entire layout, or - if that’s not possible - of one detail in the layout?

The result should be available outside of the layout in Top view.

HI feklee
You can rotate make2d generated curve

#coding=utf-8
import rhinoscriptsyntax as rs

import Rhino.Geometry as rg

def make2d():
obj = rs.GetObject(“Choose to do make2d operation objects”,rs.filter.polysurface,True,True)
rs.EnableRedraw(False)
rs.Command("-_Make2D " + " ")
curves = rs.GetObjects(“Select objects to project”,rs.filter.curve,True,True)
XPlane = rg.Plane.WorldXY
origin = XPlane.Origin
xaxis = XPlane.XAxis
if not curves:return
return rs.RotateObjects(curves,origin ,90,xaxis)

if name == “main”:
make2d()