@m_magalhaes Thanks ,it works well,I modified the code according to your answer.
1 draw line not obscured by any object.solved
2 before i just draw line in MouseImput() (not add Draw() funtion),as above pic/code, Now i draw line in Draw(),it works well.solved