Are you looking for help regarding FreeCAD python scripting?

Need help, or want to share a macro? Post here!
User avatar
bernd
Posts: 11672
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Are you looking for help regarding FreeCAD python scripting?

Postby bernd » Fri Nov 08, 2013 10:10 pm

Welcome here, and thanks for your interest in python scripting features of FreeCAD! Our FreeCAD-Documentation allready offers some excellent articles regarding this topic.

- Short tutorial made for who is totally new to Python.

- Python scripting tutorial and FreeCAD Scripting Basics for a brief introduction of python scripting in FreeCAD.

- Part Module, Scripting explains the basics about scripting of geometric primitives and (topological) shapes.

- Topological data scripting describes lots of methods for creating and modifying Part shapes from python.

- FreeCAD TopoShape API docu lists all attributes and methods for TopoShapes and thus for all shapes of Part Modul.



- Code snippets contains examples, pieces, chunks of FreeCAD Python code collected from the forum.

- Macros recipes contains ready to use macros to add functionality to FreeCAD.

- Scripting examples contains some more complex scripting examples.

- Scripted objects Python Features, python-scripted objects which behave exactly as any other FreeCAD objects.

- FreeCAD dialog creation chunks of FreeCAD Python for creation of dialogs.

- Module Creation to add a new modules and workbenches in FreeCAD.

- Extra python modules has listed several external python modules that can be downloaded freely.

- External python tutorials has links to good generic tutorials, not specific to FreeCAD.

- More links you will find at the Power users hub and Category:Python_Code sections of the FreeCAD-Wiki.

- In the end the FreeCAD python API documentation will give you endless informations about all kind of functions.

- In the very last end FreeCAD Python Template Modules at the source code will give you some code to start with.


have fun, bernd
suhasj123
Posts: 3
Joined: Sat Jul 15, 2017 5:43 am
Location: India
Contact:

Re: Are you looking for help regarding FreeCAD python scripting?

Postby suhasj123 » Sat Aug 12, 2017 3:48 am

Thanks for a awesome post I am new to python I simply want say thank you for the tutorial for who are new to python I haven't saw the topics but as I learn more about python surely come and visit other topics too. :) :) :)
muennemann
Posts: 1
Joined: Wed Apr 24, 2019 9:35 pm

Re: Are you looking for help regarding FreeCAD python scripting?

Postby muennemann » Wed Apr 24, 2019 9:38 pm

Hello Bernd:

Thank you for the tutorial on how to run FEA with calculix and Python. In my version of FreeCAD, we have fea.run() rather than fea.ccx_run().

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13541 (Git)
Build type: Release
Branch: releases/FreeCAD-0-17
Hash: 9948ee4f1570df9216862a79705afb367b2c6ffb
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedStates (en_US)

---
Frank[bug][/bug]
User avatar
bernd
Posts: 11672
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Are you looking for help regarding FreeCAD python scripting?

Postby bernd » Wed May 01, 2019 4:50 pm

your version is outdated! Use 0.18.1 or even better 0.19 if you work with FEM.
keithsloan52
Posts: 1916
Joined: Mon Feb 27, 2012 5:31 pm

Re: Are you looking for help regarding FreeCAD python scripting?

Postby keithsloan52 » Fri Jun 05, 2020 8:39 pm

Should this not be also in the wiki or somewhere more permanent?
emanresu
Posts: 1
Joined: Thu Dec 24, 2020 2:05 pm

Could somebody pls help me in FC an Python.

Postby emanresu » Thu Dec 24, 2020 2:42 pm

Hi There,

My english is unpractised. My german is much better. I try it now on english.
I have a degree in mechanical engineering. I make my study in informatics. My programming experience is wide but shallow.
I make my student project in FreeCAD with Python. I have many years expertise in CAD design in quite all of the well-known CAD softwares. It takes wery long time, to find the FreeCAD and Python methods to realize my ideas. The task is quite hard. 3D-modelling in other programs -> search similar, feasible practices -> create my parametric modelling. Most of my experience is in ProE/Creo. I could think strictly parametric. I know CATIA too. I could think well in 3D chaos.
My questions:
-In a body there can be made some datums, like point, line, plane. Could I create these with names or there is only a label to refer them?
-If I create some datums in a body, how can I refer them later (rename, get...)?

Thanks in advance

With many good wishes for the season and the coming year

Tom
937
Posts: 23
Joined: Thu May 13, 2021 10:11 pm

Re: Are you looking for help regarding FreeCAD python scripting?

Postby 937 » Sat Jun 12, 2021 4:44 pm

bernd wrote: Fri Nov 08, 2013 10:10 pm - Code snippets contains examples, pieces, chunks of FreeCAD Python code collected from the forum.

- Macros recipes contains ready to use macros to add functionality to FreeCAD.
All the links I've tried give me "File not found."

Code snippets is here now for example: https://wiki.freecadweb.org/Code_snippets
Otuoniyo7
Posts: 1
Joined: Sun Jun 13, 2021 12:02 pm

Re: Are you looking for help regarding FreeCAD python scripting?

Postby Otuoniyo7 » Sun Jun 13, 2021 12:04 pm

Links are not going anymore, kindly help us check the issue
jgg
Posts: 3
Joined: Sun Jun 13, 2021 1:46 pm

Re: Are you looking for help regarding FreeCAD python scripting?

Postby jgg » Sun Jun 13, 2021 5:11 pm

User avatar
Roy_043
Posts: 3085
Joined: Thu Dec 27, 2018 12:28 pm

Re: Are you looking for help regarding FreeCAD python scripting?

Postby Roy_043 » Mon Jun 14, 2021 6:58 pm

jgg wrote: Sun Jun 13, 2021 5:11 pmLinks broken
Can you be more specific. All internal links appear in blue, so these are valid. And I think I have just checked all external links. All of them are valid as well.