Is there a guide anywhere showing how to convert the Revit API Docs into Python?
Is there an IDE that is helpful to code the Python and can even do debugging? VS Code? This is good on installing autocomplete but is 5 years old: Loom | Free Screen & Video Recording Software | Loom
I am already stuck in my first attempts…
import clr
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
def ProcessParallelLists(_func, *lists):
return map( lambda *xs: ProcessParallelLists(_func, *xs) if all(type(x) is list for x in xs) else _func(*xs), *lists )
def tolist(obj1):
if hasattr(obj1,"__iter__"): return obj1
else: return [obj1]
viewNames = tolist(IN[0])
mins = tolist(IN[1])
maxs = tolist(IN[2])
doc = DocumentManager.Instance.CurrentDBDocument
#Get 3D View ViewFamilyType
viewType = FilteredElementCollector(doc).OfClass(ViewFamilyType).ToElements().Find(lambda x : x.ViewFamily == ViewFamily.ThreeDimensional)
def CreateView(name, newmax, newmin):
view = View3D.CreateIsometric(doc, viewType.Id)
view.Name = name
newbox = BoundingBoxXYZ()
newbox.Max = newmax
newbox.Min = newmin
view.SetSectionBox(newbox)
return view
TransactionManager.Instance.ForceCloseTransaction()
t = Transaction(doc,'Create3D')
t.Start()
views=ProcessParallelLists(CreateView, viewNames, mins, maxs)
t.Commit()
#TransactionManager.Instance.ForceCloseTransaction()
#Assign your output to the OUT variable
OUT = views