I hope it's ok to piggyback onto this discussion. I have been trying out schedules and have been facing some difficulties.
Here are my filters and CSV Attributes in BlenderBim:
Here is how it looks in OpenOffice:
Here is what it looks like when I use BBim to build the schedule into a SVG:
The things I would like to solve are:
1. Is it possible to replace the underscore with a space character? I tried {{value}}.replace("_", " ")
2. Is there a BBim solution to get ElementType values to appear in place of the USERDEFINED value of PredefinedType
3. In the ods file my column headings are bold, should they pass through to the SVG?
4. In the ods file I wrapped my cells but this doesn't seem to be translating correctly. Is there a way to fix this in OpenOffice?
5. Is there a way in BBim to apply rounding to a {{value}} that consists of multiple values?
6. I can't get my storey names to appear, what am I doing wrong?
7. Is there a BBim solution to not show the None values (or just show one)?
Good questions. I think i only know the following...
4. It's advisable to use opengost-b font when making your svg schedules. A lot of spacing, etc, is currently hardcoded assuming this font. If you use a different font, things can start looking weird.
6. maybe try storey.Name?
Thanks @theoryshaw, looks like the 'correct' way is to use the name field then. If the Tag field is only used by external exporters, should it not be a read-only value in BlenderBIM, or maybe it shouldn’t be in the UI at all. Is there a use case for having it visible or editable?
IfcFurniture, PredefinedType="CHAIR"
This doesn't seem to work. Am i missing something?
In this scenario, the instance is taking on the Type's PredefinedType.
@theoryshaw said:
yes, that works! Thanks @bruno_perdigao
...
Intuitively, it seems like the other way should work too... since it's an 'Attribute'. ¯\_(ツ)_/¯
makes sense, it should work both ways after this commit
"IfcClassificationReference, Description=description" or ""IfcClassificationReference, Identification=test_code"?
do you know what to use in a cost schedule as query? It would be very useful to select classified elements in a BoQ IfcSlab, classification="1.1.1.1.11" works in Grouping and Filtering > Search but when used in a cost schedule it does not return anything
thanks
EDIT
for some reason IfcSlab, classification="1.1.1.1.11" works now in a .csv cost schedule to automate BoQ QTO extraction, I'm still curious to know the use case of IfcClassificationReference, Description.. though, cheers
The other way would be to switch in ifcbimtester to use single quotes for the values. Than the query would be in single quotes and I could use double quotes inside the query. But this is in the contrary to all ifcbimtester.
Thus ... would it be possible to support single quotes inside the querys as well.
from ifcopenshell.util import selector
# query = "IfcWall, AllplanAttributes.Status=Neubau, material=Dämmung, Name='Dämmung eingelegt'" # error
query = "IfcWall, AllplanAttributes.Status=Neubau, material=Dämmung, Name=\"Dämmung eingelegt\"" # works
eles = ifcopenshell.util.selector.filter_elements(ifcfile, query)
works for the query. I will give it a try in ifcbimtester. But since ifcbimtester is human readable any IT-specific character does cut the peoples number who do understand the text into a half ;-)
BTW: this query system is very very very cool. It replaces tons of lines of code I have made over years by a simple statement. :-)
no it does not work in ifcbimtester ... but nevermind ...
features:
Szenario: Layernames test
#* All "{ifcos_query}" elements have a layer named "{layer_name}"
* All "IfcColumn, AllplanAttributes.Status=Neubau, material=FertigelementBeton, Name=Stuetze" elements have a layer named "_HB_N_BTL_FB_Stuetze"
* All "IfcWall, AllplanAttributes.Status=Neubau, material=\"Fertigelement Beton\", Name=Wandschicht" elements have a layer named "_HB_N_BTL_FB_Wand"
works:
All "IfcColumn, AllplanAttributes.Status=Neubau, material=FertigelementBeton, Name=Stuetze" elements have a layer named "_HB_N_BTL_FB_Stuetze" 162 eles, 0.68s
does not work:
All "IfcWall, AllplanAttributes.Status=Neubau, material=\"Fertigelement Beton\", Name=Wandschicht" elements have a layer named "_HB_N_BTL_FB_Wand" 162 eles, 0.01s
File "C:\0_BHA_privat\progr\FreeCAD\FreeCAD_0.21.xxxxx\bin\lib\site-packages\behave\model.py", line 1329, in run
match.run(runner.context)
File "C:\0_BHA_privat\progr\FreeCAD\FreeCAD_0.21.xxxxx\bin\lib\site-packages\behave\matchers.py", line 98, in run
self.func(context, *args, **kwargs)
File "C:\Users\BHA\AppData\Roaming\FreeCAD\Mod\bimtester\code_bimtester\bimtester\features\steps\layer_and_style\en.py", line 40, in step_impl
ifcos_query_has_following_layer_name(
File "C:\Users\BHA\AppData\Roaming\FreeCAD\Mod\bimtester\code_bimtester\bimtester\features\steps\layer_and_style\en.py", line 152, in ifcos_query_has_following_layer_name
target_elements = ifcopenshell.util.selector.filter_elements(IfcStore.file, target_ifcos_query)
File "C:\0_BHA_privat\progr\FreeCAD\FreeCAD_0.21.xxxxx\bin\lib\site-packages\ifcopenshell\util\selector.py", line 311, in filter_elements
transformer.transform(filter_elements_grammar.parse(query))
File "C:\0_BHA_privat\progr\FreeCAD\FreeCAD_0.21.xxxxx\bin\lib\site-packages\lark\lark.py", line 645, in parse
return self.parser.parse(text, start=start, on_error=on_error)
File "C:\0_BHA_privat\progr\FreeCAD\FreeCAD_0.21.xxxxx\bin\lib\site-packages\lark\parser_frontends.py", line 96, in parse
return self.parser.parse(stream, chosen_start, **kw)
File "C:\0_BHA_privat\progr\FreeCAD\FreeCAD_0.21.xxxxx\bin\lib\site-packages\lark\parsers\earley.py", line 266, in parse
to_scan = self._parse(lexer, columns, to_scan, start_symbol)
File "C:\0_BHA_privat\progr\FreeCAD\FreeCAD_0.21.xxxxx\bin\lib\site-packages\lark\parsers\xearley.py", line 146, in _parse
to_scan = scan(i, to_scan)
File "C:\0_BHA_privat\progr\FreeCAD\FreeCAD_0.21.xxxxx\bin\lib\site-packages\lark\parsers\xearley.py", line 119, in scan
raise UnexpectedCharacters(stream, i, text_line, text_column, {item.expect.name for item in to_scan},
lark.exceptions.UnexpectedCharacters: No terminal matches 'B' in the current parser context, at line 1 col 68
Status=Neubau, material=\"Fertigelement Beton\", Name=Wandschicht
^
Expected one of:
* PLUS
* COMMA
I haven't looked at the BIMTester codebase in ages and I have no idea what it supports or doesn't support anymore. Can you try printing to check exactly what behave is parsing and sending off to the filter_elements function? That can help narrow it down whether the problem is with behave and quotes, or BIMTester and quotes, or filter_elements itself.
The problem is in behave because the standard parse step matcher can not parse a " inside a step parameter which is marked by "{}" ...
I found a (may be not smart, but working) work around which I will use ATM. Before sending the query to IfcOpenShell I replace ' by " like this ...
from ifcopenshell.util import selector
query = "IfcWall, AllplanAttributes.Status=Neubau, material=Dämmung, Name='Dämmung eingelegt'".replace("'",'"') # works
eles = ifcopenshell.util.selector.filter_elements(ifcfile, query)
This way I do not need to change anything in ifcbimtester and do not need to investigate more ATM.
@steverugi said:
I'm still curious to know the use case of IfcClassificationReference, Description.. though, cheers
You can use it in scripts if you want to get all matching IfcClassificationReferences or in Spreadsheet Export if you want to export list of all used classification references with certain description (though you won't be able import it back, I think, as importing .csv typically requires guid).
If you want to get list of all elements that has a refernce with some description then I don't think it's possible - when you do IfcSlab, classification="1.1.1.1.11" it checks all references Name "1.1.1.1.11" (so you can use the same syntax to match by reference name) and then it checks references' Identification but never checks Description.
Comments
Where can I find this filter in the latest release? I would like to filter by LoadBearing and EXISTING and make it visible in the 3D view.
I'm not fully understanding the correct syntax here.
I tried Grouping and Filtering on my computer and I noticed some odd behavior:
Pset_WallCommon.Combustible with True throws an error

but if I use Pset_WallCommon.Combustible with
1
(instead of True) it works..it would be interesting to know the right way to do it, thanks
For me these work with the input 1, true gives the error.

Blender 3.6.8 BBIM 240222
I think you have to type "TRUE"

@steverugi

@Bimlooser
I hope it's ok to piggyback onto this discussion. I have been trying out schedules and have been facing some difficulties.



Here are my filters and CSV Attributes in BlenderBim:
Here is how it looks in OpenOffice:
Here is what it looks like when I use BBim to build the schedule into a SVG:
The things I would like to solve are:
1. Is it possible to replace the underscore with a space character? I tried
{{value}}.replace("_", " ")
2. Is there a BBim solution to get
ElementType
values to appear in place of theUSERDEFINED
value ofPredefinedType
3. In the ods file my column headings are bold, should they pass through to the SVG?
4. In the ods file I wrapped my cells but this doesn't seem to be translating correctly. Is there a way to fix this in OpenOffice?
5. Is there a way in BBim to apply rounding to a
{{value}}
that consists of multiple values?6. I can't get my storey names to appear, what am I doing wrong?
7. Is there a BBim solution to not show the
None
values (or just show one)?Good questions. I think i only know the following...
4. It's advisable to use opengost-b font when making your svg schedules. A lot of spacing, etc, is currently hardcoded assuming this font. If you use a different font, things can start looking weird.
6. maybe try
storey.Name
?Thanks @theoryshaw. I did first try
storey.Name
but that didn't work and I presumed so because I am initially pulling in types not instances.@tim 2. Try
predefined_type
@tim I see you're using
Tag
as the ID or Type Mark. I wanted to do that too, and seems to be the way to do it, but might want to read the following...Thanks @theoryshaw, looks like the 'correct' way is to use the name field then. If the Tag field is only used by external exporters, should it not be a read-only value in BlenderBIM, or maybe it shouldn’t be in the UI at all. Is there a use case for having it visible or editable?
Would it be possible to select all objects belonging to a bSDD classification such as https://search.bsdd.buildingsmart.org/uri/buildingsmart/ifc/4.3/class/IfcBuiltSystemLOADBEARING
Sure, it's
ifcopenshell.util.selector.filter_elements(ifc_file, 'IfcTypeProduct, IfcProduct, classification="IfcBuiltSystemLOADBEARING"')
Or from BBIM UI:

IfcFurniture, PredefinedType="CHAIR"
This doesn't seem to work. Am i missing something?
In this scenario, the instance is taking on the Type's PredefinedType.
I don't know if I understood correctly, but try
IfcFurniture, query:predefined_type=CHAIR
Remember to remove the equal sign here:

Does that work?
yes, that works! Thanks @bruno_perdigao
...
Intuitively, it seems like the other way should work too... since it's an 'Attribute'.
¯\_(ツ)_/¯
makes sense, it should work both ways after this commit
Hi @Andrej730
I am trying to implement RICSclassification (NRM1 and 2)
how would I catch something like
#105=IFCCLASSIFICATIONREFERENCE($,'1.1.3.1','Lowest floor construction',#66,$,$);
or any other classified element of which I know the code (in this case '1.1.3.1'), or its description
since the BoQ does not export classification (yet?) it would be useful to do it through spreadsheet
thanks
EDIT
please disregard my request, I figured it out
for those who are looking for the same:
as selector for spreadsheet export to csv:
classification.Name returns 'Lowest floor construction'
classification.Identification returns '1.1.3.1'
in Search use the "Classification" filter and apply the Identification code in the cell:
cheers
"IfcClassificationReference, Description=description" or ""IfcClassificationReference, Identification=test_code"?
Hi @Andrej730
please where in the UI you use the following?
do you know what to use in a cost schedule as query? It would be very useful to select classified elements in a BoQ
IfcSlab, classification="1.1.1.1.11"
works in Grouping and Filtering > Search but when used in a cost schedule it does not return anythingthanks
EDIT
for some reason
IfcSlab, classification="1.1.1.1.11"
works now in a .csv cost schedule to automate BoQ QTO extraction, I'm still curious to know the use case ofIfcClassificationReference, Description..
though, cheersI am faceing a problem ...
ifcbimtester uses doublequotes to mark values ... https://github.com/IfcOpenShell/IfcOpenShell/blob/69c197c1a4f047791befbae11e890be64026b7e7/src/ifcbimtester/bimtester/features/steps/classification/en.py
I started to use a query in ifcbimtester as value (which is very very cool :-)) I need to use double quotes ATM to mark it as a value. But if inside the query I need to quote something I can not use double quotes I would need to use a single quote, but single quotes do not work in the querries.
The other way would be to switch in ifcbimtester to use single quotes for the values. Than the query would be in single quotes and I could use double quotes inside the query. But this is in the contrary to all ifcbimtester.
Thus ... would it be possible to support single quotes inside the querys as well.
cheers bernd
Couldn't you just escape the quotes?
like this ... ?
works for the query. I will give it a try in ifcbimtester. But since ifcbimtester is human readable any IT-specific character does cut the peoples number who do understand the text into a half ;-)
BTW: this query system is very very very cool. It replaces tons of lines of code I have made over years by a simple statement. :-)
no it does not work in ifcbimtester ... but nevermind ...
features:
works:
does not work:
I haven't looked at the BIMTester codebase in ages and I have no idea what it supports or doesn't support anymore. Can you try printing to check exactly what behave is parsing and sending off to the filter_elements function? That can help narrow it down whether the problem is with behave and quotes, or BIMTester and quotes, or filter_elements itself.
The problem is in behave because the standard parse step matcher can not parse a " inside a step parameter which is marked by "{}" ...
I found a (may be not smart, but working) work around which I will use ATM. Before sending the query to IfcOpenShell I replace ' by " like this ...
This way I do not need to change anything in ifcbimtester and do not need to investigate more ATM.
cheers bernd
You can use it in scripts if you want to get all matching IfcClassificationReferences or in Spreadsheet Export if you want to export list of all used classification references with certain description (though you won't be able import it back, I think, as importing .csv typically requires guid).
If you want to get list of all elements that has a refernce with some description then I don't think it's possible - when you do
IfcSlab, classification="1.1.1.1.11"
it checks all references Name "1.1.1.1.11" (so you can use the same syntax to match by reference name) and then it checks references' Identification but never checks Description.I have problems on quantities ... I am not able to use any regex or a
*
to filter multiple quantity values or alle object with the quantity attachedcheers bernd
attached the file ...
Isn't that because you're using regex on non-strings?