Hi,
I am trying to use the newopening method for wall in a python script block. I input wall elements , start point and end point of the rectangle. When I run it python messages that a “level is expected”. So actually I noticed the newopening for shaft is exactly same method. I do not know how to procede. Please anyone can suggest me?
Thanks
PS. I am quite new to this world so i apologize for any stupid thing that I have done!
here the code
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
openings = []
walls = UnwrapElement(IN[0])
points = IN[1]
for idx in range(0,len(walls)):
StartPoint = (points[idx][0])
EndPoint = (points[idx][2])
TransactionManager.Instance.EnsureInTransaction(doc)
opening = doc.Create.NewOpening(walls[idx],StartPoint,EndPoint)
TransactionManager.Instance.TransactionTaskDone()
openings.append(opening)
OUT = openings