Skip to content

Instantly share code, notes, and snippets.

@chuongmep
Created June 13, 2020 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuongmep/11baf2775d037abf246bd3cd86748ae9 to your computer and use it in GitHub Desktop.
Save chuongmep/11baf2775d037abf246bd3cd86748ae9 to your computer and use it in GitHub Desktop.
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
import Autodesk
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
a = UnwrapElement(IN[0])
v = UnwrapElement(IN[1])
TransactionManager.Instance.EnsureInTransaction(doc)
for i in a:
i.SetDatumExtentType(DatumEnds.End0,v, DatumExtentType.ViewSpecific)
i.SetDatumExtentType(DatumEnds.End1,v, DatumExtentType.ViewSpecific)
TransactionManager.Instance.TransactionTaskDone()
OUT = v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment