-
Notifications
You must be signed in to change notification settings - Fork 15
Add View Filters #1502
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
Add View Filters #1502
Conversation
...com/BHoM/Revit_Toolkit into Revit_Toolkit-#1444-FilterPrototype
- Enum LinePattern - Enum SolidPattern - Class OverrideGraphicSettings - Class FilterRule
- Enumeration Class that works as an attribute of the FilterRule Class, allowing to avoid the use of several abstract and concrete classes for each type of rule type.
... Views namespace
...com/BHoM/Revit_Toolkit into Revit_Toolkit-#1444-FilterPrototype
To simplify the mirroring representation of the Revit API classes within the BHoM, it's necessary to add a concrete classe, subclass of FilterRule, that corresponds to the FilterValueRule from Revit API. Whatever sub-class type as well as Evaluator class type will be represented in BHoM via enumeration classes assigned to the RevitFilterRule and RevitFilterValueRule as attributes.
Instead of using a single class FilterRule with an Enumeration encapsulated to represent all the different Revit API Filter Rules, we go for creating multiple classes and sub-classes in BHoM as well, thus trying to match as much as possible the classes structure that is present in the API.
Add NOT_START_WITH and NOT_ENDS_WITH enum values to the enumeration. These are required to implement the View Filtering in BHoM.
Useful to create LevelFilterRule objects
...Convert.ToRevit Namespace
Greater, GreaterOrEqual, Less, LessOrEqual are added to reflect the types and names of the subclasses of the Revit API class FilterStringRuleEvaluator
...ype Enum Values Greater, GreaterOrEqual, Less, LessOrEqual
...mRevit Namespace
Instead of keeping the conversion of FilterRule objects from/to Revit/BHoM within the ParameterFilter/ViewFilter conversion classes only, we split the code in each different FilterRule Class keeping the code more modular and reusable.
...collection streams
The View3D Class is a subclass of the View Class. To let the BHoM run the Update method on the View3D class, we need to specify an overloaded version of the Update Method taking a View3D class instance rather than a View class instance as input.
...neric Type Since View3D is a subclass of View in the Revit API, we can make the Update method work on a generic type T, specifying that it must be extending the revit api superclass View.
Using this abstract class it's possible to decouple the ParameterValuePresence Class from the FilterValueRule class.
...num values and Revit Category Objects
GCRA101
commented
Oct 16, 2024
@pawelbaran, you can find the commit with all your comments incorporated in the following commit
53b434e
pawelbaran
commented
Oct 16, 2024
@BHoMBot check compliance
@pawelbaran to confirm, the following actions are now queued:
- check
code-compliance - check
documentation-compliance - check
project-compliance - check
branch-compliance - check
dataset-compliance - check
copyright-compliance
...al Casing Co-authored-by: Pawel Baran <pawel.baran@burohappold.com>
...rrors in PatternId assigment
@pawelbaran, thanks for your comments.
Updated code now in latest commit 501e2c2
pawelbaran
commented
Oct 16, 2024
Thanks for the activity @GCRA101 - can see your commits addressing my comments on the ongoing basis 😃 I think the code is OK now, I am slowly switching to testing. Found quite a few bugs so far:
- filters with
Worksetstill throw error on pull
image - same as above for has value and does not have value
- updating categories using Push/Update causes reset in the filter (which kind of makes sense - after modifying categories one would need to check if all parameters are available in each of them, so not surprised it breaks things, it almost feels like updating categories should not be allowed)
- changing any parameter in the filter resets all parameters in the filter
All above cases are covered in the test materials I updated here. Please note these materials cover only the most basic cases, you'll need to test the code against real life models too. But this is the last step, let's focus on getting the basics sorted first 👍
Uh oh!
There was an error while loading. Please reload this page.
Issues addressed by this PR
Closes #1501
Test GH Script - All Algorithms
Test Revit Model - 3D View Filters Table
It is now possible to push, pull and update View Filters in Revit via the BHoM and assign to them OverrideGraphicSettings in selected Views.
Test files
Grasshopper File
[https://burohappold.sharepoint.com/:u:/r/sites/BHoM/02_Current/12_Scripts/02_Pull%20Request/BHoM/Revit_Toolkit/%231502-AddViewFilters/TestScript.gh?csf=1&web=1&e=l3Fafx](url)
Revit Files
[https://burohappold.sharepoint.com/:u:/r/sites/BHoM/02_Current/12_Scripts/02_Pull%20Request/BHoM/Revit_Toolkit/%231502-AddViewFilters/TestRevitfile_PushModel.rvt?csf=1&web=1&e=O8L8fo](url)
[https://burohappold.sharepoint.com/:u:/r/sites/BHoM/02_Current/12_Scripts/02_Pull%20Request/BHoM/Revit_Toolkit/%231502-AddViewFilters/TestRevitfile_PullModel.rvt?csf=1&web=1&e=ge2KZI](url)
[https://burohappold.sharepoint.com/:u:/r/sites/BHoM/02_Current/12_Scripts/02_Pull%20Request/BHoM/Revit_Toolkit/%231502-AddViewFilters/TestRevitfile_UpdateModel.rvt?csf=1&web=1&e=yj4ExY](url)
Changelog