I am a noob in ifcopenshell and ifcpatch.
My goal is to create individual ifc files for every prefabricated concrete element with accessories from an existing ifc file created with Tekla. The following code causes an error which i did not find on other forums. Any help or tips are appreciated.
There are multiple IfcWall entities in my ifc file.
Perhaps a little context... I work from Belgium, where we use a decimal comma in stead of a point. Maybe this could be important.
output = ifcpatch.execute({
"input": "S:file.ifc",
"file": ifcopenshell.open("S:/file.ifc"),
"recipe": "ExtractElements",
"arguments": [".IfcWall"]
})
Traceback (most recent call last):
File "S:\IFC\IfcOpenShell\Test ifcpatch ExtractElements.py", line 43, in <module>
output = ifcpatch.execute({
File "S:/Python/Lib/site-packages/ifcopenshell/ifcpatch\ifcpatch\__init__.py", line 79, in execute
patcher.patch()
File "S:/Python/Lib/site-packages/ifcopenshell/ifcpatch\ifcpatch\recipes\ExtractElements.py", line 64, in patch
for element in ifcopenshell.util.selector.filter_elements(self.file, self.query):
File "S:\Python\lib\site-packages\ifcopenshell\util\selector.py", line 263, in filter_elements
transformer.transform(filter_elements_grammar.parse(query))
File "S:\Python\lib\site-packages\lark\lark.py", line 658, in parse
return self.parser.parse(text, start=start, on_error=on_error)
File "S:\Python\lib\site-packages\lark\parser_frontends.py", line 104, in parse
return self.parser.parse(stream, chosen_start, **kw)
File "S:\Python\lib\site-packages\lark\parsers\earley.py", line 279, in parse
to_scan = self._parse(lexer, columns, to_scan, start_symbol)
File "S:\Python\lib\site-packages\lark\parsers\xearley.py", line 152, in _parse
to_scan = scan(i, to_scan)
File "S:\Python\lib\site-packages\lark\parsers\xearley.py", line 125, in scan
raise UnexpectedCharacters(stream, i, text_line, text_column, {item.expect.name for item in to_scan},
lark.exceptions.UnexpectedCharacters: No terminal matches ',' in the current parser context, at line 1 col 1
,IfcWall
^
Expected one of:
* ESCAPED_STRING
* BANG
* __ANON_3
* TYPE
* __ANON_1
* __ANON_0
* SLASH
* __ANON_4
* LOCATION
* CLASSIFICATION
* __ANON_2
* MATERIAL