Hi,
I’m trying to create a new SketchPlane
based on a Face
of a Ceiling
element:
geoElement = element.get_Geometry(Options())
for geo in geoElement:
for face in geo.Faces:
if (face.Area > area):
area = face.Area #update area size
largestFace = face #save face
#faceSurface = face.GetSurface()
#faceRef = face.Reference
faceNormal = face.FaceNormal
faceOrigin = face.Origin
# Transaction
t2 = Transaction(doc, "Test")
t2.Start()
#facePlane = Plane.CreateByNormalAndOrigin(faceNormal, faceOrigin)
facePlane = Plane.CreateByNormalAndOrigin(XYZ(0,0,1), faceOrigin)
#sketchPlane = SketchPlane.Create(doc, faceRef)
sketchPlane = SketchPlane.Create(doc, facePlane)
#sketchPlane = SketchPlane.Create.Overloads[Document, Plane](doc, facePlane)
As you can see from the commented lines, I’ve tried creating the SketchPlane
with specific OverLoads
, and also without, and using both the face’s GetSurface()
as well as the face’s Reference
, but nothing works.
I’m getting either:
Exception: Curve must be in the plane
Parameter name: pCurveCopy
or
TypeError: Multiple targets could match: Create(Document, Plane), Create(Document, Reference), Create(Document, ElementId)
Am I using the OverLoads
method wrong?
Any ideas on how to successfully create the SketchPlane
?