AsValueString Revit 2021

Hello, practicing with python, I had a problem, when I try to obtain the value of the comments parameter, it comes out null, even though I have values ​​in those parameters, I am with Revit 2021, I tested it with revit 2022 and it does recognize the value of the parameter, would anyone know what causes this problem and how could I solve it?

Update: Verifying the problem, I tried AsString instead of AsValueString and it worked, what is the difference between those two methods? since in Revit 2022 the AsValueString works without problems for me. Thank you very much in advance

Hi,

It seems to me that .AsValueString() was originally intended for double or integer storage parameters that have units.

Information here

https://help.autodesk.com/view/RVT/2025/ENU/?guid=Revit_API_Revit_API_Developers_Guide_Basic_Interaction_with_Revit_Elements_Parameters_Parameter_html

2 Likes

Hi @davidmisaico01, use AsString() instead of AsValueString().

1 Like