Macro hinge (charnière)

From FreeCAD Documentation
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
This page is a translated version of the page Macro hinge and the translation is 100% complete.
Other languages:

Hinge Simul

Description
Simulation de mouvement d'une charnière.

Version macro : 1.0
Date dernière modification : 2014-09-09
Version FreeCAD : All
Téléchargement : The File 20140908b_Hinge-1.fcstd
ToolBar Icon
Auteur: Mario52
Auteur
Mario52
Téléchargement
The File 20140908b_Hinge-1.fcstd
ToolBar Icon
Liens
Version Macro
1.0
Dernière modification
2014-09-09
Version(s) FreeCAD
All
Raccourci clavier
None
Voir aussi
None

Description

Simulation de pivotement d'une charnière

Utilisation

Ouvrez les deux fichiers (20140908b_Hinge-1.FCMacro et 20140908b_Hinge-1.FCStd) dans FreeCAD avec 2 écrans (Menu: Fenêtre > Mosaïque) et lancez la macro ou lancez la macro avec le bouton

Charnière
Charnière

Le Fichier

20140908b_Hinge-1.fcstd

Script

ToolBar Icon

20140908b_Hinge-1.FCMacro

import FreeCAD, FreeCADGui, Draft, Part
from FreeCAD import Base
import time

ii = 0
pas = 0
for ii2 in range(180):
    if pas == 0:
        if ii > 90:
            pas = 1
        ii += 5
    else:
        if ii < 1:
            pas = 0
        ii -= 5
   
    App.getDocument("_0140908b_Hinge_1").Fusion.Placement=App.Placement(App.Vector(0,0,0), App.Rotation(App.Vector(0,0,1),ii), App.Vector(44.4,6.9,0))
    App.Console.PrintMessage(str(ii2)+"  " + str(ii)+"  " + str(pas) +"\n")
    Gui.updateGui()
    time.sleep(0) #modify the time here


Liens

La page de discussion sur le forum Struggling with LinearPattern (again)