I would like to get an example code for alignment of objects, providing a constraint for that
such as during the kinematics
the two axis should be aligned with a tolerance of say + or - 0.05
the distance between two nodes with a tolerance of + or - 0.025
I would recommend to look at the tutorial Making things move and at our reference manual. What you are asking for is a definition of constraint for two kinematic measures - try checking the reference manual for AnyKinEqSimpleDriver and other types of drivers, which are the modeling objects for constraint definition. If you search for this one in the AMMR - you will get a plenty of examples.