mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 05:00:53 +00:00
handle emptry description field
This commit is contained in:
committed by
Thomas Krijnen
parent
808a16ba4a
commit
2d06a79842
@@ -298,13 +298,16 @@ class DescriptionTransform(Transformer):
|
|||||||
def parse_mvd(description):
|
def parse_mvd(description):
|
||||||
text = ' '.join(description)
|
text = ' '.join(description)
|
||||||
parser = Lark(mvd_grammar, parser='lalr')
|
parser = Lark(mvd_grammar, parser='lalr')
|
||||||
parse_tree = parser.parse(text)
|
|
||||||
parsed_description = DescriptionTransform()
|
parsed_description = DescriptionTransform()
|
||||||
try:
|
try:
|
||||||
|
if not text:
|
||||||
|
parsed_description.mvd = ['Not defined']
|
||||||
|
return parsed_description
|
||||||
|
parse_tree = parser.parse(text)
|
||||||
parsed_description.transform(parse_tree)
|
parsed_description.transform(parse_tree)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
parsed_description.mvd = 'Not defined'
|
parsed_description.mvd = ['Not defined']
|
||||||
return parsed_description
|
return parsed_description
|
||||||
|
|
||||||
class file:
|
class file:
|
||||||
@@ -579,7 +582,7 @@ class file:
|
|||||||
| “SpaceBoundary1stLevelAddOnView”
|
| “SpaceBoundary1stLevelAddOnView”
|
||||||
| “SpaceBoundary2ndLevelAddOnView”
|
| “SpaceBoundary2ndLevelAddOnView”
|
||||||
"""
|
"""
|
||||||
return '.'.join(self.parsed_description.mvd)
|
return ','.join(self.parsed_description.mvd)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def mvd_comments(self) -> str:
|
def mvd_comments(self) -> str:
|
||||||
|
|||||||
Reference in New Issue
Block a user