In this paper, the consensus and optimization of a multiagent system in a distributed optimization problem with bounded constraint is discussed under the general step-size, which is square nonsummable. Firstly, a distributed projective subgradient algorithm is designed for time-varying directed communication topologies under the event-triggered mechanism. Secondly, the consensus and optimization of the system state and the ergodic average sequence are discussed. Finally, the effectiveness of the design algorithm and the correctness of the theoretical results is verified by a simulation example. INDEX TERMS Multiagent system, distributed optimization, event-triggered, general step-size, time-varying switching digraph.