INVALID PARAMETER

INVALID PARAMETER

richard.schaffranek
Enthusiast Enthusiast
1,790 Views
7 Replies
Message 1 of 8

INVALID PARAMETER

richard.schaffranek
Enthusiast
Enthusiast

Hello, 

 

I have a question, we are comming accross a lot of Parameter which show up sa Internal but have an INVALID BuiltInParameter Type, could anybody enlighten us what that means and how that happens, documentation is a little short on the topic:

richardschaffranek_0-1632122770396.png

 

thx Richard

0 Likes
1,791 Views
7 Replies
Replies (7)
Message 2 of 8

jeremy_tammik
Alumni
Alumni

The list you show contains built-in parameter enumeration values such as WALL_ATTR_HEIGHT_PARAM:

 

https://www.revitapidocs.com/2022/fb011c91-be7e-f737-28c7-3f1e1917a0e0.htm

 

INVALID is also one of the built-in parameter enumeration values; loom at the end of the list, or search for the term.

 

I cannot tell you how it ended up in your list.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 8

richard.schaffranek
Enthusiast
Enthusiast

Thanks I know what I am showing and how to find the list of Built in Parameters.

My question was:

How can a parameter get an INVALID Built in Parameter Type and what does it mean?
Maybe to illustrate this a bit further:

When a parameter has the built-in parameter type:

WALL_ATTR_HEIGHT_PARAM: I can somehow guess that this is connected to a Wall and most likly has something to do with the height of the wall. However I still don't know  on what bases revit assignes the Parameter to an Element. But I could guess that It will be assigned to walls. So despite documentation I can develop an idee about what and why...

INVALID: Can't make any guess about the meaning and how a parameter gets this built in parameter type.... -> https://en.wikipedia.org/wiki/Kangaroo#Terminology


So again the question was:
How can a parameter get an INVALID Built in Parameter Type and what does it mean?

0 Likes
Message 4 of 8

jeremy_tammik
Alumni
Alumni

Thank you for clarifying and sorry for being obtuse. I asked the development team for you. They may not know all the possible causes, so I hope some of your peers can chip in with their experience as well.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 5 of 8

RPTHOMAS108
Mentor
Mentor

If you get 'Invalid' then it isn't a built-in parameter, could be a project parameter or shared parameter etc.

 

RevitAPI.chm InternalDefinition.BuiltInParameter:

"For a build-in parameter this property equals one of the BuiltInParameter enumerated values. For custom-defined parameters, such as shared, global, or family parameters the value is always BuiltInParameter.INVALID."

 

Message 6 of 8

richard.schaffranek
Enthusiast
Enthusiast

Okay,

To be more specific, we are using the BuiltInParameter Enum as identifiere if there is no GUID assigned to the Parameter. So e.g. Shared Parameters would have an external definition where we would get a GUID from, same goes for custom Family Parameters.

@Anonymous:

Okay, so just looked it up, if a Family Parameter would be a buildInParameter within the Family, it would load as INVALID into another document, confused ....

0 Likes
Message 7 of 8

richard.schaffranek
Enthusiast
Enthusiast

Okay I have had a look at Family Parameters and found this: 

foreach (FamilyParameter familyParam in familyDoc.FamilyManager.Parameters)
{
    string familyParamName = familyParam.Definition.Name;
    try
    {
        Guid guid = familyParam.GUID;
        TaskDialog.Show("Revit",familyParamName + " is shared. Guid is " + guid);
    }
    catch (System.Exception)
    {
        TaskDialog.Show("Revit",familyParamName + " is NOT shared");
    }
}

 Now I am wondering, can't I just simply us the isShared property to determin if it has a guid.

isShared == true -> GUID ?

isShared == false -> no GUID ?

Or could there be cases where this doesn't hold?

0 Likes
Message 8 of 8

RPTHOMAS108
Mentor
Mentor

Yes the .IsShared indicates a shared parameter and they are the only ones with a GUID value.

 

An ExternalDefinition only exist in the shared parameter file as soon as it goes into project it becomes an InternalDefinition.

 

Within project/family document every SharedParameter has an associated SharedParameterElement containing the GuidValue. So you can filter for these by class to find Name, Guid and also the definition containing Spec etc.