Integrating FreeCAD with python4delphi
This repository includes a demo program to test integration of FreeCAD (an opensource 2D/3D CAD/CAM solution) with an application program using python4delphi.
Line Selection
Arc Selection
Circle Selection

See the FreeCAD forum post: https://forum.freecadweb.org/viewtopic.php?f=22&t=42530
Note: The sample application was created with the Lazarus IDE and complied with Free Pascal.
- Windows & Linux operating System
- Latest FreeCAD (https://github.com/FreeCAD/FreeCAD/releases)
- Lazarus IDE
- LazSerial via Lazarus Online Package Manager
- PythonForLazarus via Lazarus Online Package Manager
- With Lazarus IDE, open the Lazarus project information file for CodeSharkFC (
./CodeSharkFC.lpi) - Build the application
- This program is designed with the assumption that you are working with 2D drawings.
- The Draft workbench Shape 2D View tool can be handy in creating 2D outlines of an object.
- FreeCAD objects may need to be downgraded to their "sub components" via the Draft Downgrade command.
See FreeCADSetupNotesLinux.txt for Linux specific issues.
Error: Error - could not load a Python engine
Problem: FreeCAD install does not ?always? load all the required Python files for python4delphi to the interface properly.
Solution: Installing python from python.org (current FreeCAD version Python 3.8.6) fixes this issue.
Error: Error - no qt platform plugin could be initializeds
Problem: Problem with QT6 looking for ..\platforms\ in the directory of the executable (in this case CodeSharkFC.exe).
Solution: You should be able to set environment variable QT_PLUGIN_PATH to point to ..FreeCAD_x.x\lib\qt6\plugins\platforms but I have not had any luck with this.
Workaround is to copy contents of ..FreeCAD_x.x\lib\qt6\plugins\platforms to ..\CodeSharkFC\platforms