Definition
Extension methods enable you to add methods to existing types without creating new derived type.
Extension methods are static methods of a special type so that they are written in code as if they were part of the calling object’s class. In reality the compiler with generate the IL code like for a static class.
With the instalation of Dynamo you get a dll file called RevitNodes.dll.
It is located in <drive>:\Program Files\Dynamo\Dynamo Revit\<version>\Revit_<version>\RevitNodes.dll
This file adds new extension methods to several Design Script classes and Revit classes. You can import it using the clr in python. When imported it brings up new methods in the namespace Revit.GeometryConversion
The GeometryPrimitiveConverter handles primitive types conversion while GeometryConversion namespace has several methods for converting curves, solids, etc
Usage
import clr clr.AddReference("RevitNodes") import Revit clr.ImportExtensions(Revit.GeometryConversion) from Revit import GeometryConversion as gp #The inputs to this node will be stored as a list in the IN variables. dataEnteringNode = IN """DS Point to revit XYZ""" dbPoint = IN[0].ToXyz() """DS Vector to Revit XYZ""" dbVector = IN[1].ToXyz() """DS Coordinate System to Revit Transform""" dbTransform = IN[2].ToTransform() dbSolid = IN[3].ToRevitType() #dbcurve = IN[4].ToRevitType() or dbcurve = gp.ProtoToRevitCurve.ToRevitType(IN[4]) """XYZ to DS Point""" dsPoint = dbPoint.ToPoint() """XYZ to DS Vector""" dsVector = dbVector.ToVector() # DS Solid from DB Solit dsMesh = dbSolid[0].ToProtoType() #Assign your output to the OUT variable. OUT = dbPoint,dbVector,dbTransform,dbSolid,dbcurve,dsPoint,dsVector,dsMesh