Difference between the APIs

The main differences are:

  • With .NET you can extend the user interface and thus create rich UIs, with Python you can only make “UI” using properties.
  • With Python you can program simulation logic that runs as part of the simulation, with .NET implementing such logic is limited.
  • Python scripts within components are saved with the simulation model, .NET add-ons you always need to distribute and install separately. Python code is also easily editable for customization, while .NET add-ons will need to be recompiled using Visual Studio or the command line toolset.
  • With .NET you can use any .NET Framework 4 compatible libraries, background threads etc. With Python you are limited to pure Python 2 libraries and the few others that come with VC. In Python threading is not supported which makes certain things like socket communication very inefficient and difficult.
  • All of VC’s UI is implemented on top of the public .NET API, so anything that can be done through the UI is also possible to do from your own code with the .NET API. With Python limitations may apply.
  • Development of .NET add-ons greatly benefits from the debugging capabilities of Visual Studio, including hot reload. With Python you can’t attach a debugger. The .NET API also being strongly typed, Intellisense works nicely and you don’t need to constantly read the API documentation for each detail like with Python.

Your example seems to be just design-time layout configuration, so it could be done with a .NET add-on. I would do it as such unless the things like easy customization of the Python code is important for you.

4 Likes