Dear nam_vt,
You need to calculate axis you want manually.
Assume the two elements are column, and you want to rotate the element around XYZ.BasisZ.
Following codes show you how to create the axis that you want to use:
LocationPoint locationPt1 = element1.Location as LocationPoint;
LocationPoint locationPt2 = element2.Location as LocationPoint;
Line lineBetweenColumns = Line.CreateBound(locationPt1.Point, locationPt2.Point);
XYZ centerOfLine = lineBetweenColumns.Evaluate(0.5, true);
//there is the axis you can use for rotate
Line axis = Line.CreateUnbound(centerOfLine, XYZ.BasisZ);
Jim Jia
Autodesk Forge Evangelist
https://forge.autodesk.com
Developer Technical Services
Autodesk Developer Network
Email: Jim.Jia@autodesk.com