Translate

docs/0.4/freecad/basefunction
docs/0.3/freecad/basefunction
part = document.addObject("Part::Feature",name)
outer = Part.makeCylinder(d2,s)
inner = Part.makeCylinder(d1,s)
part.Shape = outer.cut(inner).removeSplitter()
SourceTranslationState
42
This assumes that the [blt file]({{ doc(general, blt-files) }}) for this part
is already created, and you have a python function that creates the part that
you want to add to BOLTS. For more information on part scripting in FreeCAD see
the [FreeCAD documentation on this topic](http://freecadweb.org/wiki/index.php?title=Power_users_hub).
On suppose que le [fichier blt]({{ doc(general, blt-files) }}) pour cette pièce
est déjà créée, et que vous avez la fonction python de création de la pièce que
vous voulez ajouter à BOLTS. Pour plus d'informations concernant la création de pièces au moyen d'un script dans FreeCAD voir
la [documentation FreeCAD dans ce sujet](http://freecadweb.org/wiki/index.php?title=Power_users_hub).
43

### The function


### La fonction
44
As an example we use the follwing function to create washers:
On utilise la fonction suivant de création d'un boulon comme exemple :
45
import Part
import Part
46
def washer1(params,document):
key = params['key']
d1 = params['d1']
d2 = params['d2']
s = params['s']
name = params['name']
def washer1(params,document):
key = params['key']
d1 = params['d1']
d2 = params['d2']
s = params['s']
name = params['name']
47
part = document.addObject("Part::Feature",name)
outer = Part.makeCylinder(d2,s)
inner = Part.makeCylinder(d1,s)
part.Shape = outer.cut(inner).removeSplitter()
part = document.addObject("Part::Feature",name)
outer = Part.makeCylinder(d2,s)
inner = Part.makeCylinder(d1,s)
part.Shape = outer.cut(inner).removeSplitter()
48
This function uses the CSG facilities of FreeCAD, but it is equally possible to
use BRep scripting.
Cette fonction utilise les capacités CSG de FreeCAD, mais il est également possible
d’utiliser un script BRep.
49
It is necessary to write the function such that it is a function of two
parameters, a dict of parameter names and values, and a FreeCAD document. The
keys of this dict will be the names of the parameters of the part, as described
in the blt file. There is an additional parameter `name` that holds the name of
the part.
50
In the first part of the function, we are assigning local variables with the
parameter values as a shortcut. In the second part of the function, we add a
new object to the document, create the geometry and assign it to the part.
`removeSplitter` cleans up artifacts resulting from CSG operation under certain
circumstances.
51
### Put it to the right place
52
This function should reside in a file (in this case called `washer.py`) with
extension `.py` in a subdirectory of the freecad directory which is named after
the collection to which the part belongs (in this case `washer`). This
directory must contain a empty file called `__init__.py` and the base file for
this collection (in this case `washer.base`).
6 months ago Anonymous user has suggested
Take Flomax At Night Zithromax While Pregnant [url=http://byuvaigranonile.com]viagra[/url] Prezzo Levitra Online Propecia Contra Minoxidil Vagra For Over 60years Old Propecia Heart Problems Amoxicillin Missed Period

Suggested change:

Take Flomax At Night Zithromax While Pregnant [url=httpart = doc://byumentvaigranonile.addcom]viagra[/url] Prezzo Levitra Online Propecia Contra Minoxidil Vagra For Over 60years Old Propecia Heart Probject("Part::Feature",name)
outer = Part.makeCylinder(d2,s)
inner = Part.makeCylinder(d1,s)
part.Shape = outer.cut(inner).removeSplitter()
lems Amoxicillin Missed Period

Loading…

Things to check

Glossary

Source Translation
No related strings were found in the glossary.

Source information

Comments
docs/0.4/freecad/basefunction docs/0.3/freecad/basefunction
Source string age
3 years ago
Translation file
translations/fr/LC_MESSAGES/docs.po, translation unit 47
String priority
Medium