AutoCAD Mechanical toolset provides a sample application developed using the mechanical structure API, to convert simple non-mechanical structure drawings to mechanical structure.
The AMSMIGRATE command starts a wizard that converts the following objects to mechanical structure:
Prior to mechanical structure, the recommended workflow to create an assembly structure was to use a combination of blocks, block part references, and layer groups. In most cases, company-specific naming conventions were used to organize these entities. A migration tool that can take advantage of the naming conventions can migrate legacy drawings more efficiently than a generic migration tool such as the AMSMIGRATE command.
You can use the application programming interface (API) to construct a migration tool that is customized to take advantage of your naming conventions. The API ships with a sample migration tool created using Visual Basic for Applications (VBA). You can alternatively customize this tool to suit your purpose.
Please refer to the API documentation for details.