Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter framework modification #1076

Merged
merged 6 commits into from
Nov 27, 2020

Conversation

thumDer
Copy link
Contributor

@thumDer thumDer commented Nov 26, 2020

I've modified the select_parameters function and the underlying ParamDef() a little:

  • Now the IsReadOnly filter is optional instead of hardcoded, but the default behaviour stays the same (not showing ReadOnly). We have a lot of usecases where we need to get the ReadOnly parameters as well.
  • I've modified the Parameter item_template to show if a parameter is ReadOnly, and also added a few extra info about the parameter itself into a ToolTip, to help identify the parameters.
  • It follows that I had to modify the ParamDef() named tuple aswell, to contain the readonly attribute, and the parameter definition itself. The reason for the last one is that it is a much better way to get an elements parameter by their definition (parameter = Element.get_Parameter(Definition)) instead of their name with LookupParameter(string), because in actual projects parameter name duplications happen. A lot. This is also a reason for the added ToolTip

I've kept the order of the attributes for the ParamDef() to keep it backward compatible for commands that get the attributes from the tuple by their index instead of their name.

2020-11-26_19-33-20

@eirannejad
Copy link
Collaborator

This is a great PR. Thank you! @thumDer

@eirannejad eirannejad changed the base branch from develop to pr/1076 November 27, 2020 17:54
@eirannejad eirannejad merged commit e62d802 into pyrevitlabs:pr/1076 Nov 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants