I am running Revit 2017. My tool (IExternalApplication) is intended to work on HostObjAttributes (Walls, Floors etc.) and their parameters. These parameters are of the Parameter Class - a class which does not inherit from the Element Class. Nevertheless we find a Parameter.Id property (of type ElementId), which makes me hope that I can use it to directly access a Parameter object without iterating over all ElementTypes (HostObjAttributes inherits from ElementType) and their GetParameters() methods.
So is there a way that a FilteredElementCollector(myDocument, someParameterOfAnHOA.Id) can find the Parameter object(s)? On first glance I expected FilteredElementCollector.WhereElementIsNotElementType() to be usefull in this scenario, but it looks like it is always used with ToElements() - returning an IList<Element> which in my understanding can't contain any Parameter object - so how do I use WhereElementIsNotElementType() correctly? Or am I missing something fundamentally obvious?
I do not believe the parameter id refers to the individual Parameter.
The Parameter is basically just a value stored on each BIM element.
The parameter id probably refers to the parameter definition instead; its Revit API class name is Definition:
https://www.revitapidocs.com/2020/8fe04f37-04e1-9e93-ffdb-e3900908e42a.htm
Ok cool that would actually make some sense.
But does that mean for a given Parameter its Parameter.Id == Parameter.Definition.Id ?
Both Ids have the description "The id of the parameter. " in their respective documentation and are of type ElementId.
On the other hand, i can't really retrieve a definition, as it isn't an Element aswell. So is the bottom line seems to be that neither Id is of use for my current scenario, right?
I think it is probably of great use in filtering.
The Building Coder posted several recent discussions related to that, e.g.:
I have seen that post, but the solution to the 'related' question works with a ParameterELement. As far as I know I can't get the parameters of HostObjectAttributes as a ParameterElement, right?
Thanks by the way for your awesome blog in general and the fast responses here though, I hope my return questions are specific enough and aren't too annoying - I'm trying my best to get a deeper understanding of the Revit API.
Can't find what you're looking for? Ask the community or share your knowledge.