New interactive Python pane in Digi3D.NET

April 25, 2017 programming python

One of the main goals for this year 2017 was to add to Digi3D.NET support for programming Python, and today we have fulfilled that goal. We had planned to develop this functionality in the future, but a support ticket that came to us two weeks ago has caused us to change our roadmap. I copy here the content of the technical support ticket:

Is it possible to print the list of codes of the .TAB file to see the codes I have, or can I just open it with a text editor and select them by hand? Can I print from the code tables editor? Thank you.

The answer is no, there is no way to print the code list of a given code table. You can make a console program that uses the objects provided by Digi3D.NET, but that requires programming knowledge on the one hand and a compiler like Visual Studio .NET on the other, which in practice has almost no users of Digi3D.NET. However, this question was the ideal candidate to force us to implement support for Python within the program itself. As a result we have added a new pane, which can be opened by the menu option Window/Python interactive. This pane is a console of Python and will allow us to create programs without leaving Digi3D.NET and in the language Python that is very easy to program. Below I show you what you have to type in the pane of Python interactive to get the list of codes of our active code table:

for codigo in diging.DigiTab.Codes:
    print codigo.Name + ' ' + codigo.Description

As simple as that. If you type it, a list of code will appear in the interactive Python window, then you can use the right mouse button to copy the code to the clipboard. Below is a video showing it in action:


Back to the blog