I'm trying to create a class with several list attributes and a method inside in Revit API.
This class is to check some shared parameters that indicate the template version of a model and collect the relevant parameters.
I guess my main question is about how to append items from the method to the list attributes of the class.
Advice would be much appreciated!
class TemplateChecker(object):
def __init__(self):
self.version_old = []
self.version_new = []
self.version_unknown = []
self.sp_collection = lib.get_shared_parameters()
def is_new_template(self):
found_parameter = False
for parameter in self.sp_collection:
if parameter.Name == "TemplateVersion-New":
self.version_new.append(parameter)
found_parameter = True
elif parameter.Name == "TemplateVersion-Old":
self.version_old.append(parameter)
found_parameter = False
elif "template" in parameter.Name.lower():
self.version_unknown.append(parameter)
found_parameter = False
return found_parameter