@@ -5466,6 +5466,8 @@ def match_vector_pattern(k_vec, k_vec_dict):
54665466 r'<OPTION VALUE="([^"]+)">([^<]+)</OPTION>' ,str_tmp
54675467 )
54685468
5469+ proj_pth = os .path .split (os .path .abspath (G2frame .GSASprojectfile ))[0 ]
5470+
54695471 G2frame .OnFileSave (None )
54705472 orgFilName = G2frame .GSASprojectfile
54715473 phsnam = phase_sel
@@ -5512,7 +5514,7 @@ def match_vector_pattern(k_vec, k_vec_dict):
55125514 cif_fn_part2_tmp = radio_val .split (")" )[1 ].split ("," )[0 ]
55135515 cif_fn_part2 = cif_fn_part2_tmp .split ()[- 1 ]
55145516 cif_fn = f"{ phase_nam } _{ cif_fn_part1 } _{ cif_fn_part2 } .cif"
5515- cif_fn = os .path .join (os . getcwd () , cif_fn )
5517+ cif_fn = os .path .join (proj_pth , cif_fn )
55165518 with open (cif_fn , 'wb' ) as fl :
55175519 fl .write (out_cif .encode ("utf-8" ))
55185520
@@ -5533,7 +5535,7 @@ def match_vector_pattern(k_vec, k_vec_dict):
55335535 Phase [key ] = rd .Phase [key ]
55345536
55355537 newname = rd .Phase ['General' ]['Name' ]
5536- Phase ['General' ]['Name' ] = newname
5538+ Phase ['General' ]['Name' ] = phsnam
55375539
55385540 # rename the phase in the data tree
55395541 G2phsG .renamePhaseName (G2frame ,Phase ,phaseTreeId ,Phase ['General' ],newname )
0 commit comments