Create plane using python

I want to take the coordinates of the vertices from Excel and make a plane to cut the object. It is necessary to make a plane with four or three coordinates. Can I get a Python code related to this? :cold_sweat:

Hi @wodud9492 ,

What do you mean with plane ? A topo ? Workplane?
it is imput-driven f.e. CSV (i would recoment)

KR

Andreas

that is workplane like plane.by three points node.

OK @wodud9492 a refernceplace thats driven by 3 points

1 Like

A Dynamo plane can be built in Python using this code snippet (assuming you have the geometry library loaded in already). Note that pntsLIst needs to be a single list of at least 3 points:

plane = Plane.ByBestFitThoughPoints(pntsList)

A geometric plane (nothing you can see in the user interface) in Revit is a bit different. The exact API call is here: CreateByThreePoints Method

Note that this takes XYZ objects as inputs, so you’ll need to build XYZs from the X, Y, and Z values you were using to build points.

Any particular reason you’re using Python instead of standard Dynamo?

1 Like