Creating a custom dialog to automate a task (Become an expert)

The Python programming language in FreeCAD allows us to use PyQt4 or PySide to add our own widgets to make custom graphical user interfaces. In this recipe, we will create a dialog box that lets us create a simple box.

Getting ready

If the Draft workbench is functioning properly in FreeCAD, then you already have PyQt4 installed on your computer. Open a new document, so that we have space for our 3D box to appear.

How to do it...

The following is some code that will make a dialog pop-up, which lets us create a 3D solid box with a few parameters:

  1. Type the following code into the Python console exactly as shown. Python is case and indent sensitive. Be consistent on indentation. We will use ...

Get FreeCAD [How-to] now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.