One edge of the part is always left out when creating chamfer using macro code

Hi I am facing some difficulties in creating the macro code for chamfer. I dont know why always one edge of the model is always left out, as seen in the screenshot below. Do let me know asap on this issue. Much appreciated  I have also attached my macro code too. The code is based on user input where a user will key in the details such as length, width, etc and the code will create a model. 

SolidworksApi/macros