BHoM / BHoM_Engine

Internal manipulation of the BHoM
GNU Lesser General Public License v3.0
26 stars 15 forks source link

Reflection_Engine: Expose quantity attributes on enum values #3421

Open IsakNaslundBh opened 1 month ago

IsakNaslundBh commented 1 month ago

Description:

Related to https://github.com/BHoM/BHoM/issues/1642

Add a couple of lines to this method:

https://github.com/BHoM/BHoM_Engine/blob/0471f52497ff5acc47f8e0540410e9c2e8a75b6e/Reflection_Engine/Query/Description.cs#L270-L298

Namely, add in the step

                QuantityAttribute quantity = field.GetCustomAttribute<QuantityAttribute>();
                if (quantity != null)
                    desc += $" [{quantity.SIUnit}]";

After the description attribute to allow for display of quantities relating to enum values.