Create Face or PlanarFace from Points o curves

Hello,

I am practicing the use of geometry with revit API using python. One of the questions that I have been stuck on is how to create a Face or PlanarFace with the revit API using a list of points or closed curves, very similar to what we had in Protogeometry such as Surface.ByPatch. Any recommendation?

import clr

clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import * 

pointA = XYZ(1,7,1)
pointB = XYZ()
pointC = XYZ(4,4,1)

points = [pointA, pointB, pointC]

lineA = Line.CreateBound (pointA, pointB)
lineB = Line.CreateBound (pointB, pointC)
lineC = Line.CreateBound (pointC, pointA)

lines = [lineA, lineB, lineC]

polyLine = PolyLine.Create(points)

planarFace = .......

Thanks

Amigo @Tripler123 Buenas. Coding is not my forte, but in another post with a similar problem my friend @christian.stan has published a beautiful code to make rectangles since points, maybe it will give you some ideas.

1 Like

Hi @Tripler123

I think you were looking for this

I don’t know how it works and there is no example in there, but you can try to figure it out.