The paper presents a development of an automated computational procedure for constrained dynamics (CoPCoD) dedicated to derivation of dynamical models of mechanical systems, e.g. manipulators both ground and space or mobile robotic systems, which can be composed of rigid and flexible links. They may be subjected to constraints, which are referred to as programmed, may come from performance requirements, e.g. work or services a system is dedicated to. The CoPCoD structure offers systematic modeling of either open or closed loop constrained structures and results in computationally efficient numerical dynamical equations derivation. The CoPCoD development has its background in the generalized programmed motion equations (GPME) algorithm developed successfully for rigid models of mechanical systems subjected to high order nonholonomic constraints, however, the GPME was not fully automated for computer equation derivations. The two main motivations that underlie the CoPCoD development are to extend the GPME to flexible system models and make it fully automated to computer equation derivations for large classes of systems. The paper presents the general scheme of the CoPCoD architecture and examples which illustrate its application advantages.