Skip to content

Commit

Permalink
added missing arg delLastNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
shimwell committed May 7, 2024
1 parent 61d5e5c commit 95abe9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/geouned/GEOUNED/LoadFile/LoadFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ def get_label(label, delLastNumber):
return label


def getCommentTree(obj):
def getCommentTree(obj, delLastNumber):
recursive_list = []
c_obj = obj
while c_obj.InList:
label = get_label(c_obj.InList[0].Label)
label = get_label(c_obj.InList[0].Label, delLastNumber)
recursive_list.append(label)
c_obj = c_obj.InList[0]

Expand Down
8 changes: 4 additions & 4 deletions src/geouned/GEOUNED/LoadFile/LoadSTEP.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def load_cad(filename, mat_filename, delLastNumber, default_mat=[], comp_solids=

for elem in doc_objects:
if elem.TypeId == "Part::Feature":
comment = LF.getCommentTree(elem)
comment = LF.getCommentTree(elem, delLastNumber)
if not elem.Shape.Solids:
print(
"Warning: Element {:} has no associated solid".format(
Expand All @@ -77,7 +77,7 @@ def load_cad(filename, mat_filename, delLastNumber, default_mat=[], comp_solids=
comment = comment + "/" + label
if elem.InList:
# MIO: lightly modification of label if required
label_in_list = LF.get_label(elem.InList[0].Label)
label_in_list = LF.get_label(elem.InList[0].Label, delLastNumber)
encl_label = re.search(
"enclosure(?P<encl>[0-9]+)_(?P<parent>[0-9]+)_", label_in_list
)
Expand Down Expand Up @@ -107,15 +107,15 @@ def load_cad(filename, mat_filename, delLastNumber, default_mat=[], comp_solids=
xelem = [elem]
while xelem and not tempre_mat:
# MIO: Modification of label if required
temp_label = LF.get_label(xelem[0].Label)
temp_label = LF.get_label(xelem[0].Label, delLastNumber)
tempre_mat = re.search("_m(?P<mat>\d+)_", "_" + temp_label)
xelem = xelem[0].InList

# Search for dilution definition in tree
xelem = [elem]
while xelem and not tempre_dil:
# MIO: Modification of label if required
temp_label = LF.get_label(xelem[0].Label)
temp_label = LF.get_label(xelem[0].Label, delLastNumber)
tempre_dil = re.search("_d(?P<dil>\d*\.\d*)_", temp_label)
xelem = xelem[0].InList
# Paco end
Expand Down

0 comments on commit 95abe9f

Please sign in to comment.