#!python cubit.cmd('reset') cubit.cmd('brick x 1 ') cubit.cmd('vol all copy move x 1') cubit.cmd('vol all copy move y 1 ') cubit.cmd('vol all copy move z 1 ') cubit.cmd('merge all') cubit.cmd('mesh volume all') #get all merged surfaces merged_surfs = cubit.parse_cubit_list('surface', 'with is_merged') #create a block for each surface #create an attribute on that block indicating the volume id #where the surface's nomal is with respect to block_id = 1 for surface_id in merged_surfs: #create the block tmp_str = "block "+str(block_id)+" surface "+str(surface_id) cubit.cmd(tmp_str) #give it a single attribute tmp_str = "block "+str(block_id)+" attribute count 1" cubit.cmd(tmp_str) #assign the value of that attribute tmp_str = "in surface "+str(surface_id) vols_of_surf = cubit.parse_cubit_list('volume',tmp_str) tmp_str = "block "+str(block_id)+" attribute index 1 "+str(vols_of_surf[0]) cubit.cmd(tmp_str) block_id += 1