Hello pyRevit Friends
I have a big problem with a function.
It is working properly and gives me a list as output, but as soon as I want to change or add anything to the function i get errors because of expected/unexpected indents.
- I tried to remove all indents and make new one with tabs, as result the list will only have one item.
- I tried to throw the code into a beautifier, as result the list will only have one item.
- I asked ChatGPT, it says everything is fine.
After 2 hours of trying to fix this I have to give up.
It seems that there is an indention mistake but this mistake makes the code magically work.
Here is the working code and a screenshot how it looks in notepad++
def PaperSize():
PaperSizeStrings = []
PaperSizeElements=[]
SizeErrors=[]
for sheet in sheets:
firstTTBL = FilteredElementCollector(doc,sheet.Id).OfCategory(BuiltInCategory.OST_TitleBlocks).FirstElement()
width = firstTTBL.get_Parameter(BuiltInParameter.SHEET_WIDTH).AsValueString()
if width == "1,19 m":
size = "A0"
elif width == "0,84 m":
size = "A1"
elif width == "0,59 m":
size = "A2"
elif width == "0,42 m":
size = "A3"
else:
size = "A0"
error = "error"
SizeErrors.append(error)
PaperSizeStrings.append(size)
Would appreciate any help!
Kind regards!