For each block in the simulink diagram, it finds the inports. For each inport the function searches for the corresponding source port.
it deletes the line, then redraws it using either autorouting on or off.
where can I get more info about SrcPortHandle and DstPortHandle? I even can't find them in matlab help file.
Mostly yes, I personally used it when automatically generating simulink models. depending on the complexity of the model I found it usefull to switch between autorouting on or off. In a simpel model 'off' resulted in the best look, but in slightly more complex ones that resulted in a spider web like tangle of lines, in this case the orthogonal look using autorouting was better looking.
I also use it when I forget my mouse, and have to rely on a mousepad, as it can be difficult to connect the lines neatly if one source block is connected to multiple destinations (i.e. when you cant use ctrl+click to quickly connect blocks).
What is the reason that one would redraw the lines? To clean up the block diagram?