Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 66705

Re: Moving from UnitType/ParameterType to ForgeTypeId problem

$
0
0

I'm working on a way to make this ParameterType to ForgeTypeId transaction flexible.

 

using ForgeParameterTypeType = #if (Revit2021 || Revit2020 || Revit2019 || Revit2018 || Revit2017) Autodesk.Revit.DB.ParameterType; #else Autodesk.Revit.DB.ForgeTypeId; #endif public struct ForgeParameterType { private ForgeParameterTypeType value; private ForgeParameterType(ForgeParameterTypeType value) { this.value = value; } public static implicit operator ForgeParameterType(ForgeParameterTypeType value) { return new ForgeParameterType(value); } public static implicit operator ForgeParameterTypeType(ForgeParameterType type) { return type.value; } } public static class ForgeParameterTypeId { public static ForgeParameterType YesNo = #if (Revit2021 || Revit2020 || Revit2019 || Revit2018 || Revit2017) ParameterType.YesNo; #else SpecTypeId.Boolean.YesNo; #endif public static ForgeParameterType Text = #if (Revit2021 || Revit2020 || Revit2019 || Revit2018 || Revit2017) ParameterType.Text; #else SpecTypeId.String.Text; #endif }

 

I don't know if has a better way, I still need to match all the ParameterType with SpecTypeId and create a unique ForgeParameterTypeId.


Viewing all articles
Browse latest Browse all 66705

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>