diff --git a/kratos.gid/scripts/Writing/WriteGeometries.tcl b/kratos.gid/scripts/Writing/WriteGeometries.tcl index 1e613cb74..d9a44a970 100644 --- a/kratos.gid/scripts/Writing/WriteGeometries.tcl +++ b/kratos.gid/scripts/Writing/WriteGeometries.tcl @@ -29,7 +29,7 @@ proc write::printGeometryConnectivities {group etype nnodes} { # increase indent (allows folding in text editor) incr ::write::current_mdpa_indent_level # Prepare the formats dict - set formats [GetFormatDict $group 0 $nnodes] + set formats [GetFormatDict $group "" $nnodes] # Write the connectivities GiD_WriteCalculationFile connectivities $formats # decrease indent diff --git a/kratos.gid/scripts/Writing/Writing.tcl b/kratos.gid/scripts/Writing/Writing.tcl index 271f0ac9e..5cb98d93d 100644 --- a/kratos.gid/scripts/Writing/Writing.tcl +++ b/kratos.gid/scripts/Writing/Writing.tcl @@ -288,12 +288,18 @@ proc write::transformGroupName {groupid} { # Warning! Indentation must be set before calling here! proc write::GetFormatDict { groupid mid num} { + set s [mdpaIndent] + variable formats_dict set id_f [dict get $formats_dict ID] - set mid_f [dict get $formats_dict MAT_ID] - set s [mdpaIndent] - set f "${s}$id_f [format $mid_f $mid] [string repeat "$id_f " $num]\n" + set mid_str "" + if {$mid ne ""} { + set mid_f [dict get $formats_dict MAT_ID] + set mid_str [format $mid_f $mid] + } + + set f "${s}$id_f $mid_str [string repeat "$id_f " $num]\n" return [dict create $groupid $f] }