An example with 1 point on Face (to adapt if necessary)
import clr
import sys
import System
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
import Autodesk.DesignScript.Geometry as DS
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB
clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *
from Autodesk.Revit.UI.Selection import *
from System.Collections.Generic import List
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
uidoc = uiapp.ActiveUIDocument
app = uiapp.Application
viewFamilyType = FilteredElementCollector(doc).OfClass(ViewFamilyType).ToElements().Find(lambda x : x.ViewFamily == ViewFamily.Section)
v = None
TaskDialog.Show("Selection", "Select Point on Face")
ref = uidoc.Selection.PickObject(ObjectType.Face, "Select Point on Face")
elem = doc.GetElement(ref)
face = elem.GetGeometryObjectFromReference(ref)
midpoint = ref.GlobalPoint
bbxUV = face.GetBoundingBox()
faceNormal = face.ComputeNormal((bbxUV.Min + bbxUV.Max) * 0.5).Negate()
bbxElem = elem.get_BoundingBox(None)
midX = (bbxElem.Max.X - bbxElem.Min.X) * 0.5
midY = (bbxElem.Max.Y - bbxElem.Min.Y) * 0.5
#
zV = faceNormal
xV = XYZ.BasisZ.CrossProduct(faceNormal).Normalize()
yV = zV.CrossProduct(xV).Normalize()
#
t = Transform.Identity
t.Origin = midpoint
t.BasisX = xV
t.BasisY = yV
t.BasisZ = zV
sectionBox = BoundingBoxXYZ()
sectionBox.Enabled = True
sectionBox.Min = XYZ(-midX, -midY, -3)
sectionBox.Max = XYZ(midX, midY, 1)
sectionBox.Transform = t
TransactionManager.Instance.EnsureInTransaction(doc)
v = DB.ViewSection.CreateSection(doc, viewFamilyType.Id, sectionBox)
TransactionManager.Instance.TransactionTaskDone()
OUT = face, midpoint.ToPoint(), faceNormal, v
Remarks from Revit API Doc
Create a section whose view volume corresponds geometrically with the specified sectionBox. The view direction of the resulting section will be sectionBox.Transform.BasisZ and the up direction will be sectionBox.Transform.BasisY. The right hand direction will be computed so that (right, up, view direction) form a left handed coordinate system. The resulting view will be cropped, and far clipping will be active. The crop region will correspond to the projections of BoundingBoxXYZ.Min and BoundingBoxXYZ.Max onto the view’s cut plane. The far clip distance will be equal to the difference of the z-coordinates of BoundingBoxXYZ.Min and BoundingBoxXYZ.Max. The new section ViewSection will receive a unique view name. https://www.revitapidocs.com/2022/d6228f68-3643-8aaf-72bb-f9a0b4125886.htm