Line with CreateOffset isn't displayed in view

I’m using pyRevit to create an offset of the boundary of a ceiling:

def getCeilingGeometry(element):
	largestFace = []
	area = 0

	geoElement = element.get_Geometry(Options())
	for geo in geoElement:
		for face in geo.Faces:
			if (face.Area > area):
				largestFace = face

	crvSet = []
	edgeArray = largestFace.EdgeLoops

	# Transaction
	t = Transaction(doc, "Create Ceiling Boundary Offset")

	for edge in edgeArray[0]:
		crv = edge.AsCurve()
		crvSet.Add( Curve.CreateOffset(crv, 1, crv.Direction) )


	for crv in crvSet:
    return crvSet

The output is:

<Autodesk.Revit.DB.Line object at 0x00000000000017D3 [Autodesk.Revit.DB.Line]>
<Autodesk.Revit.DB.Line object at 0x00000000000017D4 [Autodesk.Revit.DB.Line]>
<Autodesk.Revit.DB.Line object at 0x00000000000017D5 [Autodesk.Revit.DB.Line]>
<Autodesk.Revit.DB.Line object at 0x00000000000017D6 [Autodesk.Revit.DB.Line]>

Not sure why but I can’t see the Lines anywhere in my model. I’m using a Transaction and creating them in Plan View… am I missing something?


I don’t think you have created anything in Plan view, your code does not show any line referencing such view.

Revit has only two types of visible lines, Detail and Model lines, and you haven’t called any of the methods to create them in the document. Use:


doc.Create.NewDetailCurve(view, line)