Skip to content

Shouldn't TryGetValueFromSource return a tuple rather than parameter itself? #1556

@pawelbaran

Description

@pawelbaran

Description:

In #1546 together with @michal-pekacki we changed TryGetValueFromSource(Element, ParameterValueSource) to return Parameter as such, while as we both agree it would be better to return the actual parameter value. The reason why we did it this way is that in case of parameters with values of type ElementId we sometimes need to work with that ElementId and sometimes with its string representation, e.g. we have a wall that goes up to Level 2, then parameter value could have 2 values depending on requested format:

  • ElementId: just Id of Level 2
  • string: "Up to Level 2"

Former is better in any sort of data-driven workflows, but the latter is required for string-based filtering.

Now another idea that we have to return tuples in such cases, e.g. (ElementId, string) for the above or (Enum, string) for enums. That would be more understandable for the wider public as well as better aligned with the general concept.

Metadata

Metadata

Labels

type:featureNew capability or enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions