# Copyright(c) 2017, Konrad K Sobon
# @arch_laboratory, http://archi-lab.net
import clr
# Import Element wrapper extension methods
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
# Import RevitAPI
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
import System
from System import Array
from System.Collections.Generic import *
import sys
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
sys.path.append(pyt_path)
if IN[2]:
try:
errorReport = None
TransactionManager.Instance.EnsureInTransaction(doc)
for i in IN[0]:
update = False
vt = UnwrapElement(i)
allParams = [id.IntegerValue for id in vt.GetTemplateParameterIds()]
exclude = set(IN[1])
toSet = []
for j in allParams:
if j not in exclude:
toSet.append(ElementId(j))
update = True
if update:
sysList = List[ElementId](toSet)
vt.SetNonControlledTemplateParameterIds(sysList)
TransactionManager.Instance.TransactionTaskDone()
except:
# if error occurs anywhere in the process catch it
import traceback
errorReport = traceback.format_exc()
else:
errorReport = "False"
# Assign your output to the OUT variable
if None == errorReport:
OUT = 0
else:
OUT = errorReport
[Webinaire] Innovation et marchés publics : comment intégrer le BIM, les jumeaux numériques et l’IA ?
Avec Laurent BIDAULT | Jeudi 10 avril à 11h