Hi ,
If I understood your question , you want to make the coordinate Z value to 0 .
So try this code , it's not that professional but I think it works for the head of the Mleader arrow , if not we need to extend the codes
to re make the leader with all its DXF codes once again and changing the coordinates Z to zero .