Hi, I am attempting to make a simplified version of http://learndynamo.com/mod2/ creation of building elevations. At this point I am not versed enough in Python to fully utilize this script.
Therefore, I have gone through VS and tried to figure out what method to use. I’m almost there I think, but I cannot convert the Dynamo point object to a Revit with the ‘To.Xyz()’ method.
Is it possible that this is failing because I did not import the correct libraries? I think i did.
# Enable Python support and load DesignScript library
import clr
# wrapping and unwrapping Revit Elements
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
clr.AddReference("RevitServices")
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
##########################################################
toggle = UnwrapElement(IN[0])
pt = UnwrapElement(IN[1])
viewId = UnwrapElement(IN[2])
#output = []
#create Revit Point facsimile
elevPt = pt.ToXyz()
# assign current document
doc = DocumentManager.Instance.CurrentDBDocument
if toggle == True:
TransactionManager.Instance.EnsureInTransaction(doc)
collector = FilteredElementCollector(doc, doc.ActiveView.Id)
elevation = ElevationMarker.CreateElevationMarker(doc, viewType, elevPt, 100)
TransactionManager.Instance.TransactionTaskDone()
OUT = elevation