Through Python scripts suggested by this post Parameter is Read Only. But it showed that Floor object has no attribute Thickness. If I changed IronPython2 to CPython3, there was no error but there is no change to the floors.
How to change floor thickness then? Because I want to change them by groups of elements (e.g., level by level), I need to process it automatically. Thank you!
for python… you have some basic gabs… in a for loop you need to collect elements… and snoop out Revit API
thats the output from the current node:
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
def SetCompoundLayerWidth(famtype, index, width):
try:
cs = famtype.GetCompoundStructure()
cs.SetLayerWidth(index,width)
famtype.SetCompoundStructure(cs)
return True
except: return False
doc = DocumentManager.Instance.CurrentDBDocument
famtypes = UnwrapElement(IN[0])
indices = IN[1]
widths = IN[2]
TransactionManager.Instance.EnsureInTransaction(doc)
if isinstance(IN[0], list):
if isinstance(IN[2], list):
if isinstance(IN[1], list): OUT = [SetCompoundLayerWidth(x,y,z) for x,y,z in zip(famtypes, indices, widths)]
else: OUT = [SetCompoundLayerWidth(x,indices,y) for x,y in zip(famtypes, widths)]
else:
if isinstance(IN[1], list): OUT = [SetCompoundLayerWidth(x,y,widths) for x,y in zip(famtypes, indices)]
else: OUT = [SetCompoundLayerWidth(x,indices,widths) for x in famtypes]
else:
if isinstance(IN[2], list):
if isinstance(IN[1], list): OUT = [SetCompoundLayerWidth(famtypes,x,y) for x,y in zip(indices, widths)]
else: OUT = [SetCompoundLayerWidth(famtypes,indices,x) for x in widths]
else:
if isinstance(IN[1], list): OUT = [SetCompoundLayerWidth(famtypes,x,widths) for x in indices]
else: OUT = SetCompoundLayerWidth(famtypes,indices,widths)
TransactionManager.Instance.TransactionTaskDone()
@Draxl_Andreas The graph nodes failed with False results. The python codes worked but it would change the thicknesses of all the elements using that type even through I only selected some (e.g., elements at a level). Is there a way to change only the input elements?