Freecad c/c++/python hybrid development / debugging scheme

Jinan Youquan Software Co., Ltd

This article mainly talks about in Visaul Studio 2019 Mixed debugging FreeCAD C/C++/Python Code environment configuration method .

stay FreeCAD in , The underlying core code uses C/C++ To write , It also provides Python Extensions Used to improve development speed . So it needs to be studied C/C++/Python Mixed debugging (Mixed-mode Debugging).VS 2017 And after , Provides “Python Development”、“Data Science” And other modules are used to support Python Development .

One 、 Based on the environment

operating system :Windows 10 64 position pro

compiler : Visual Studio 2019 Community Edition

FreeCAD;FreeCAD 0.19

LibPack: FreeCADLibs_12.1.6_x64_VC15

Two 、 Mixed debugging configuration

    2.1 install Python Native Development Tools

    2.2 Select debugger

stay FreeCADMain project , Right click ” attribute ”, Choose the hybrid debugger ,

    2.3 Appoint Python Debugging information

stay Tools/Options menu , Set the debugging information location ,

    2.4 test

DraftTools.py Contains creating segments 、 Circle and other 2D sketch elements Python Code . Set the breakpoint in the command response function that creates the line segment , At the same time Visual Studio Start in FreeCADMain, And then switch to Draft modular , Trigger “ Create line segments ” command , You can see Python Breakpoints are in effect .

3、 … and 、 Code development environment

Due to the present Visual Studio 2019 Yes Python Intellisense The level of support is not very good , It is suggested that PyCharm In the middle of Python Code development ; and C/C++ Code development is in Visual Studio 2019 In the middle of .

Reference material

  1. Python in Visual Sudio 2019

 

Read more here: Source link