I am not sure what you mean by "guessed" or "estimation". However, you should know that, with an equation like this, linear with constant coefficients, A constant will satisfy the entire equation. Rather than "guessing" $-\pi/7$ as a solution, try y= A, some undetermined constant, as a solution: Then y''= y'= 0 so the equation $3(0)+ 4(9)+ 7A= -\pi$. That satisfies the equation if and only if $A= -\pi/7$. If that was what you did, I would certainly not call it "guessing"! I would call it "knowing general properties of solutions to linear differential equations with constant coefficients".
You should have learned, when you learned this method, "undetermined coefficients", that it really only works when the right hand side is one of the types of functions that are solutions to linear differential equations with constant coefficients. Those are "polynomials", "exponentials", "sines and cosines" and combinations of those. Here, the right hand side, $\pi$, is a constant so a type or "polynomial". Another method, "variation of parameters", works for any type of right hand side but is much more complicated and may lead to integrals you cannot do.