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

Moving from UnitType/ParameterType to ForgeTypeId problem

$
0
0

Hi,

 

I've been using for quite some time the Enum ParameterType in a rather special way when it comes to creating Parameters that I need. I've implemented a property Attribute where I use ParameterType as an value.

Example:

 

 

 

 

public enum SharedParameters { [ParameterSetup("ParameterA", "{00000000-0000-0000-0000-000000000000}", BindingType.Type, ParameterType.Integer, BuiltInParameterGroup.PG_GEOMETRY, false, true, BuiltInCategory.OST_Windows, BuiltInCategory.OST_Doors, BuiltInCategory.OST_Walls)] ParameterA, [ParameterSetup("ParameterB", "{00000000-0000-0000-0000-000000000001}", BindingType.Type, ParameterType.Integer, BuiltInParameterGroup.PG_GEOMETRY, false, true, BuiltInCategory.OST_Windows, BuiltInCategory.OST_Doors, BuiltInCategory.OST_Walls)] ParameterB } public class ParameterSetup: Attribute { public ParameterSetup(string name, string guid, BindingType binding, ParameterType parameterType, BuiltInParameterGroup parameterGroup, bool allowVaryBetweenGroups, bool visible, params BuiltInCategory[] categories) }

 

 

 

 

 

 

 

Since the SpecTypeId is built as a Class and Constants are a requirement, I'm not able to just simple change from ParameterType.Integer to the proper ForgeTypeId

 

So the option I'm left with is either use the SpecTypeId.Int.Integer.TypeId (I think) string but I cannot just simply refer to that directly. I need to then type the "autodesk.spec....-1.0.0" manually that also increase the risk of typos etc for the developer refering to my API.

 

I've got the same issue in my application now when it comes to the enum UnitType that's getting replaced with this totally breaking my application on so many levels I'm not even shure where to begin.

 

Anyone got any suggestion on how I can avoid spending hundreds of hours trying to figure this out?

 

Researching this, I feel there's a great lack of documentation on which ParameterType / UnitType corresponds to what ForgeTypeId.


Viewing all articles
Browse latest Browse all 67020

Latest Images

Trending Articles



Latest Images