revitrevitpythonshell

How to verify if a parameter is empty in Revit Python Shell


I am trying to verify if a parameter exists or not in a document, and (if it exists) if it is empty or filled.

The problem is that the code always returns that the parameter is filled if it exists. Even if it exists but is empty. So lines 30 to 33 do not really work. I've tried many things already but I don't know what I'm doing wrong.

Does anybody know what is the mistake?

Thank you! enter image description here

... I'll have to add the code I was talking about in the comment here because I couldn't add a picture in there... enter image description here

Screen shot for the parameter IsExtendedWarranty: enter image description here


Solution

  • You are calling the Element GetParameters method.

    It returns a list of Parameter objects.

    To check the value of a parameter, you need to add two more steps: