Abstract The approach called Topological Functioning Modeling for Model Driven Architecture (TFM4MDA) uses a Topological Functioning Model (TFM) as a formal Computation Independent Model (CIM) within the Model Driven Architecture (MDA). The object of this research is the construction of a UML class diagram on the Platform Independent Model (PIM) level in conformity with the TFM. Nowadays this transformation is executed manually. Manual creation of models is time-consuming and there is a risk of making mistakes. These drawbacks increase expenses and reduce efficiency of TFM4MDA approach. That is why automation of transformation is useful. The paper presents an algorithm for the transformation which is written in a pseudocode and can be implemented as a tool.