With Microsoft no longer supporting VB6 development, many companies consider transferring their old software to modern programming languages. The main goal is to improve software performance and security. New technologies and approaches, like VB to C# migration, keep businesses competitive and adaptable to market changes.
More about reasons why convert VB to C#, process challenges and approaches, read here.
In this case study, we describe how we helped our customer rewrite slow AutoCAD functions and convert Visual Basic to C#. As a main result, we decrease the software license costs for 75% of our client’s users.
Business results of VB to C# migration and functions improvement
The Abto Software team finished the project on time and within our client’s budget. Our cooperation resulted in:
Our client is the US based world’s leading manufacturer in their area. We started our partnership in 2019 when they used tools written in different languages around 20 years ago. It has become increasingly hard to support such a diverse set of applications.
A single state-of-the-art tool that would be able to design all types of products.
- AutoCAD plugin was written in VBA and LISP with problems during installation;
- Each new version of AutoCAD brought new issues for the plugin;
- Some parts of the functionality stopped working completely;
- AutoCAD was still supporting VBA. But it wasn’t available by default and requires a separate download and installation.
This project perfectly fitted our profile. We had already worked with AutoCAD and converted VB to C# in several projects.
How clients benefit from VB to C# migration with Abto Software
Business security and competitiveness
Microsoft recommended stopping usage of Visual Basic 6.0 for new apps twelve years ago. In March 2020, they claimed, “We do not plan to evolve Visual Basic as a language.” One day VB can unexpectedly stop running. Even still running, VB6 has a lot of security vulnerabilities and is not compatible with many of the new technologies. So it became quite simple: want to keep up with your competitors – evolve your technologies. And better to do it with the help of professionals.
Proven experience and quality
With Abto Software team’s VB migration experience, you minimize risks for your project. We know how to migrate your software without losses of data, third-party integrations, important for business customizations. At the same time, we reduce drawbacks of old code. Our professionals have converted VB to C# in a lot of projects. For example, we migrated legacy ERP for a USA company to web, converted code of a huge management system for Swiss social authorities. We guarantee a better performing app after technology migration.
Time and money saving
Outdated technologies always require a bigger investment in software maintenance and support. Every year, there are fewer experts of old programming languages. Even if you can find them, it takes time and a lot of efforts to deal with old code written and rewritten by many developers before. Technologies of the past needed regular bug fixing. Also, their lack of flexibility prevents businesses from growing. With VB to C# migration, you give fresh air to your business.
Modern user interface
Outdated technologies always have outdated and inconvenient user interfaces. We analyze our customer business needs to create a modern UI that can be used even by less experienced users. This step allows our clients to expand the number of their users and improve general income.
Our migration approach
Starting with a thorough analysis of the plugin functionalities, we have detected the riskiest parts. We created a detailed roadmap for the conversion process.
As a result of our analyses, we decided:
1. Convert plugin to .NET C#, remove dependencies on AutoCAD and make it one of the modules of a single standalone tool. We decided to implement WPF UI using MVVM Light Toolkit.
2. Add more functionality in the AutoCAD plugin written in .NET C#. These functions should cover the needs of experienced engineers in the most complex tasks.
3. Build different modes for regular and advanced users. We planned to create simple wizards covering common workflows for regular users. Special mode for advanced users should allow executing of all possible commands in any required order.
4. Separate common code for the plugin and standalone application module into a shared library. It is supposed to ensure the same correct behaviour and reduce the possibility of desynchronization.
5. Allow reading and saving *.dwg and *.dxf formats, exporting to PDF. The cost-effective solution was to integrate a third-party library WoutWare CadLib.
How we rewrite AutoCAD functions
Programming languages conversion
Plugin workflow took input profile and applied an algorithm to produce a number of polylines. This algorithm was rewritten from VB to C# in three steps:
- Visual Basic for Applications (VBA) plugin converted to Visual Basic 6 (VB6);
- VB6 converted to Visual Basic .NET (VB.NET) with Visual Studio 2003;
- VB.NET converted to C#.
These events left us with a partially ready C# code. We needed to manually rewrite several parts of the code that were too complicated for an automatic converter.
The Lisp part made some preparations with polylines generated in the previous step. Then we used the AutoCAD command BOUNDARY. It wasn’t working correctly in AutoCAD because this command depends on a visual representation of polylines and lacks the required precision.
For a big number of polylines, BOUNDARY froze outright. So we designed and implemented a mathematically precise algorithm to replace BOUNDARY.
For the usual number of lines used before, the algorithm is almost instantaneous. In the case of a lot of lines when AutoCAD freezes, the bespoken algorithm works for a couple of seconds. We used the same algorithm in both the standalone program and the plugin.
Tan Tan Radius algorithm implementation
The frequent operation was a generation of tolerance polylines with the usage of AutoCAD Circle by Tan Tan Radius function and further replacing part of the profile with an arc of the circle.
So, we implemented our own Tan Tan Radius algorithm and fully automated replacement of the part of the polyline. When automating this routine, we also replaced native AutoCAD functions OFFSET, TRIM, EXPLODE, PEDIT.
Preparing the report file for the customer included finding an appropriate zoom level, annotating individual curves of a polyline, filling template tables with used parameters. All these numerous activities are now done with a single button click.
Unit tests writing
There were written unit tests that take a collection of input profiles, execute each workflow and compare results with etalon values. During the project, new improvements to the algorithms had to be made to account for the new types of input profiles.
Executing unit tests allowed us to quickly identify cases when new improvements broke support of old input files. Also, to resolve the issue to correctly handle all situations.
During our cooperation, the Abto Software team not only performed successful VB6 to C# migration. We also fixed issues present in the old plugin and rewrote important AutoCAD functions. As a result, our client got a good-performing and effective tool with a clear UI. Even more, were made savings on license costs for 75% of users as the standalone application doesn’t require AutoCAD.
We continue working with the company on the conversion of other applications to C# .NET WPF.
If you need an experienced team to convert VB6 to C# – we are ready to help. Let’s discuss your project!