Weld lines, generated during injection molding, can significantly reduce the mechanical performance of structures. The choosing optimal gate location technique has been developed to set weld lines as far as possible from the region of maximum stresses. A flat product case was considered as an example of a typical aircraft structural element – a pin-joint lug molding from short-fiber reinforced thermoplastic composite material. The Golden-Section search method allowed to solve the optimization problem. Autodesk Moldflow in batch mode controlled by Matlab code through Synergy API was used to solve the direct molding task of determination of the weld line location from gate location dependence. An experiment of the lugs injection molding from several gate positions was carry out to verify the numerical weld line prediction. The solved problem allows choosing the gate position for ensuring the weld lines location away from structures loaded area.