@@ -62,7 +62,8 @@ def draw(self, context):
6262 row .prop (props , "generate_ods_report" )
6363 row = self .layout .row ()
6464 row .prop (props , "flag" )
65-
65+ row = self .layout .row ()
66+ row .prop (props , "hide_skipped_specs" )
6667 if not tool .Ifc .get () or not props .should_load_from_memory :
6768 row = self .layout .row (align = True )
6869 props .ifc_files .layout_file_select (row , "*.ifc;*.ifczip;*.ifcxml" , "IFC File(s)" )
@@ -104,6 +105,9 @@ def draw(self, context):
104105 def draw_editable_ui (self , context : bpy .types .Context ) -> None :
105106 props = tool .Tester .get_tester_props ()
106107 specification = TesterData .data ["specification" ]
108+ is_skipped = specification ["total_checks" ] == 0 and specification ["cardinality" ] == "optional"
109+ if props .hide_skipped_specs and is_skipped :
110+ return
107111
108112 n_requirements = len (specification ["requirements" ])
109113
@@ -179,6 +183,34 @@ def draw_item(
179183 row .label (text = item .name , icon = "CHECKMARK" if item .status else "CANCEL" )
180184 row .label (text = item .description )
181185
186+ def filter_items (self , context : bpy .types .Context , data : IfcTesterProperties , propname : str ):
187+ items = getattr (data , propname )
188+ filter_flags = [self .bitflag_filter_item ] * len (items )
189+
190+ props = tool .Tester .get_tester_props ()
191+ if props .hide_skipped_specs :
192+ for idx , item in enumerate (items ):
193+ report = tool .Tester .report [idx ]
194+ if report ["total_checks" ] != 0 :
195+ filter_flags [idx ] |= self .bitflag_filter_item
196+ else :
197+ filter_flags [idx ] &= ~ self .bitflag_filter_item
198+
199+ filter_name = self .filter_name
200+ if filter_name :
201+ name_filtered = bpy .types .UI_UL_list .filter_items_by_name (
202+ filter_name ,
203+ self .bitflag_filter_item ,
204+ items ,
205+ "name" ,
206+ )
207+ if len (name_filtered ) == len (filter_flags ):
208+ for idx , flag in enumerate (name_filtered ):
209+ if flag == 0 :
210+ filter_flags [idx ] &= ~ self .bitflag_filter_item
211+
212+ return filter_flags , []
213+
182214
183215class BIM_UL_tester_failed_entities (UIList ):
184216 def draw_item (
0 commit comments