Defining a Beam's Coordinate System (Tekla Open API)

_config.yml

If you take a Tekla Beam, then it automatically is given a beam coordinate system. But what does it mean? The documentation doesn’t contain much helpful information. Hopefully the above image will be helpful

Also note that it defines what rotation means.

The process is opaque, but you can calulate it if you wish. I managed to backward calculate everything. You may review it in the Tekla Extension Methods open source project - of which I am the maintainer.


        public static Vector getBeamCS_ZVectorNormalized(this Vector inputBeamXVector)
        {
            if (isXVectorEqualToGlobalZVector(inputBeamXVector))
            {
                return getReferenceVector(inputBeamXVector);
            }
            else
            {
                Vector globalZ = getReferenceVector(inputBeamXVector); // which is beamY
                return inputBeamXVector.Cross(globalZ).GetNormal();// x cross Y is z
            }
        }


        /// <summary>
        /// Reflect's the a beam CS's actual y axis
        /// </summary>
        /// <param name="inputBeamXVector"></param>
        /// <returns></returns>
        public static Vector getBeamCS_YVectorLength1000(this Vector inputBeamXVector)
        {
            // x cross y returns z
            Vector zVector = getBeamCS_ZVectorNormalized(inputBeamXVector);
            return zVector.Cross(inputBeamXVector).GetNormal() * 1000;
        }




        /// <summary>        
        /// This effectively gives the reference vector for Tekla.
        //  But it is based on the input vector. 
        //  The input vector is always the xVector of the beawm.
        //  If the x vector is NOT parallel to the global z vector, then
        //  the reference vector is the global Z vector.
        //  This is the temporary "Y" vector. We use this temporary 'y' vector
        //  to calculate the beam CS's actual Z vector. And then use the actual z vector
        //  to calculate the beam CS's y vector.
        /// </summary>
        /// <param name="inputBeamXVector"></param>
        /// <returns></returns>
        public static Vector getReferenceVector(this Vector inputBeamXVector)
        {
            if (isXVectorEqualToGlobalZVector(inputBeamXVector))
            {
                return -1 * VectorExtensions.YAxis;
            }
            else
            {
                // standard xaxis comes through here.
                return VectorExtensions.ZAxis;
            }
        }

Hopefully this will benefit someone in the community.

Written on July 3, 2026