# Set Work Plane

**URL:** <https://forum.dynamobim.com/t/set-work-plane/8775>\
**Category:** Developers\
**Tags:** python\
**Created:** [January 11, 2017, 9:02am UTC](https://forum.dynamobim.com/t/set-work-plane/8775 "2017-01-11T09:02:19Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![ste\_camp](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@ste\_camp](https://forum.dynamobim.com/u/ste_camp)\
**Post date:** [January 12, 2017, 8:35am UTC](https://forum.dynamobim.com/t/set-work-plane/8775/15 "2017-01-12T08:35:32Z")

</div>

Thanks Einar, I watched the link, I made some changes to your code and now work perfecly! Thank you so much!!  
here is the final code that I created

```
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# Import Element wrapper extension methods
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

# Import geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)

# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

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

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

# The inputs to this node will be stored as a list in the IN variable.
dataEnteringNode = IN

# Unwrap elements and convert geometry from Dynamo to Revit:

bubbleEnd = UnwrapElement(IN[0]).ToRevitType()
freeEnd = UnwrapElement(IN[1]).ToRevitType()
cutVector = UnwrapElement(IN[2]).ToRevitType()
pView = UnwrapElement(doc.ActiveView.ToDSType(True))

# Create the reference plane in a transaction
TransactionManager.Instance.EnsureInTransaction(doc)
rPlane = doc.Create.NewReferencePlane(bubbleEnd,freeEnd,cutVector,pView)
TransactionManager.Instance.TransactionTaskDone()

# Set the reference plane as the sketchplane in the active view in another transaction
TransactionManager.Instance.EnsureInTransaction(doc)
sp = SketchPlane.Create(doc,rPlane.Id)
doc.ActiveView.SketchPlane = sp
TransactionManager.Instance.TransactionTaskDone()

OUT = rPlane
```

---

_[View the full topic](https://forum.dynamobim.com/t/set-work-plane/8775)._
