Curtainwall Perimeter Curve

I’m trying to get the perimeter curves that define a curtain wall, but I can only get my python node to return Autodesk.REVIT.DB.LINE. It seems like I am having trouble wrapping the lines because the lines are non visible objects, but I could also be missing something obvious. Any help is appreciated.

Ultimately I’m trying to automate curtainwall elevations, but this one piece is blocking me.

# Load the Python Standard and DesignScript Libraries
import sys
import clr
import math
#Import Revit Nodes
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.GeometryReferences)

# Import RevitAPI
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
from clr import StrongBox

# Import DocumentManager and TransactionManager
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
import System
import RevitServices

doc = DocumentManager.Instance.CurrentDBDocument

dataEnteringNode = IN

optA = Options()
optA.ComputeReferences = True
optB = Options()
optB.IncludeNonVisibleObjects = True

curtainWall = UnwrapElement(IN[0])
curtainWallGeometry = curtainWall.get_Geometry(optB)

OUT = curtainWallGeometry

You can use the “.ToProtoType()” method to access the line elements in the curtain wall. I also added an if statement to limit the method to only be run on lines, since the “get_Geometry()” method also retrieves solids from the curtain wall. Hope this helps.

# Load the Python Standard and DesignScript Libraries
import sys
import clr
import math
#Import Revit Nodes
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.GeometryReferences)

# Import RevitAPI
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
from clr import StrongBox

# Import DocumentManager and TransactionManager
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
import System
import RevitServices

doc = DocumentManager.Instance.CurrentDBDocument

curtainWallElements = []

dataEnteringNode = IN

optA = Options()
optA.ComputeReferences = True
optB = Options()
optB.IncludeNonVisibleObjects = True

curtainWall = UnwrapElement(IN[0])

curtainWallGeometry = curtainWall.get_Geometry(optB)

for item in curtainWallGeometry:
	if item.ToString() == "Autodesk.Revit.DB.Line":
		curtainWallElements.append(item.ToProtoType())
	else:
		pass

OUT = curtainWallElements
3 Likes