Macro hinge/fr: Difference between revisions

From FreeCAD Documentation
m (Created page with "{{Macro/fr|Icon=Text-x-python|Name=Hinge Simul|Name/fr=Hinge Simul|Description=Simulation de mouvement d'une charnière.|Author=Mario52}}")
No edit summary
 
(32 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages/>
{{Macro/fr|Icon=Text-x-python|Name=Hinge Simul|Name/fr=Hinge Simul|Description=Simulation de mouvement d'une charnière.|Author=Mario52}}
{{Macro/fr
|Name=Hinge Simul
|Description=Simulation de mouvement d'une charnière.
|Icon=Macro hinge.png
|Author=Mario52
|Version=1.0
|Date=2014-09-09
|FCVersion=All
|Download=The File [http://forum.freecadweb.org/download/file.php?id=7628 20140908b_Hinge-1.fcstd]<br />[https://www.freecadweb.org/wiki/images/a/a8/Macro_hinge.png ToolBar Icon]
}}


==Description==
Simulates hinge movement
Simulation de pivotement d'une charnière


[[File:Hing_00.gif|left]]{{clear}}
[[File:Hing_00.gif|left]]
{{clear}}


===Uses===
==Utilisation==


Open the 2 files (20140908b_Hinge-1.FCMacro and 20140908b_Hinge-1.FCStd) in FreeCAD with 2 screens (Menu: Windows > Tile) and click in the window and the macro and click F6 (debug macro) to run the macro or run the macro with [[File:Macro-execute.svg]]
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 [[File:Std_DlgMacroExecuteDirect.svg]]


[[File:Hing_01.png|left|300px]]{{clear}}
[[File:Hing_01.png|left|300px|Charnière]]{{clear}}


===The File===
==Le Fichier==
[http://forum.freecadweb.org/download/file.php?id=7628 20140908b_Hinge-1.fcstd]
[http://forum.freecadweb.org/download/file.php?id=7628 20140908b_Hinge-1.fcstd]
===Script===
==Script==
ToolBar Icon [[Image:Macro_hinge.png]]
20140908b_Hinge-1.FCMacro


'''20140908b_Hinge-1.FCMacro'''
<syntaxhighlight>

{{MacroCode|code=
import FreeCAD, FreeCADGui, Draft, Part
import FreeCAD, FreeCADGui, Draft, Part
from FreeCAD import Base
from FreeCAD import Base
Line 38: Line 52:
time.sleep(0) #modify the time here
time.sleep(0) #modify the time here


}}
</syntaxhighlight>

===Link===

The discussion page [http://forum.freecadweb.org/viewtopic.php?f=3&t=7606&p=62086#p62086 Struggling with LinearPattern (again)]
==Liens==
La page de discussion sur le forum [http://forum.freecadweb.org/viewtopic.php?f=3&t=7606&p=62086#p62086 Struggling with LinearPattern (again)]
{{clear}}
{{clear}}
<languages/>

Latest revision as of 16:36, 18 June 2020

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)