Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
in our c# revit addin we encountered an error when using Revit 2021 for a code part that works with Revit 2022 without a problem:
private static bool IsValidDoubleUnit(Parameter p)
=> !p.IsShared && p.HasValue && p.StorageType == StorageType.Double && UnitUtils.IsUnit(p.GetUnitTypeId());
The exception throws at calling: p.GetUnitTypeId().
The description says that it is: Thrown if this parameter is not of value type.
Well .... p.StorageType == StorageType.Double ...
Is this a known issue/restriction for the handling of the new ForgeTypeId in Revit 2021?
What is the proposed strategy of avoiding this?
Shortened Stack Trace:
Autodesk.Revit.Exceptions.InvalidOperationException
bei Autodesk.Revit.DB.Parameter.GetUnitTypeId()
bei Namespace.IsValidDoubleUnit(Parameter p) in source.cs:Zeile 294.
Thank you for any help!
Solved! Go to Solution.