Ion orbit loss is considered important for generating the radially inward electric field $E_r$ in a tokamak edge plasma. In particular, this effect is emphasized in diverted tokamaks with a magnetic X point. In neoclassical equilibria, Coulomb collisions can scatter ions onto loss orbits and generate a radially outward current, which in steady state is balanced by the radially inward current from viscosity. To quantitatively measure this loss-orbit current in an edge pedestal, an ion-orbit-flux diagnostic has been implemented in the axisymmetric version of the gyrokinetic particle-in-cell code XGC. As the first application of this diagnostic, a neoclassical DIII-D H-mode plasma is studied using gyrokinetic ions and adiabatic electrons. The validity of the diagnostic is demonstrated by studying the collisional relaxation of $E_r$ in the core. After this demonstration, the loss-orbit current is numerically measured in the edge pedestal in quasisteady state. In this plasma, it is found that the radial electric force on ions from $E_r$ approximately balances the ion radial pressure gradient in the edge pedestal, with the radial force from the plasma flow term being a minor component. The effect of orbit loss on $E_r$ is found to be only mild. How ion orbit loss will affect $E_r$ in the full-current ITER plasma pedestal is left as a subsequent study topic.