Sketcher ConstrainDistanceX/it: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 15: Line 15:
</div>
</div>


<span id="Description"></span>
==Descrizione==
==Descrizione==


Line 21: Line 22:
[[File:Constraint_H_Distance.png]]
[[File:Constraint_H_Distance.png]]


<span id="Usage"></span>
==Utilizzo==
==Utilizzo==


Line 40: Line 42:
Distance from origin:
Distance from origin:


{{Code|code=Sketch.addConstraint(Sketcher.Constraint('DistanceX', Edge, PointOfEdge, App.Units.Quantity('123.0 mm')))}}
{{Code|code=Sketch.addConstraint(Sketcher.Constraint('DistanceX', Edge, PointOfEdge, -1, 1, App.Units.Quantity('123.0 mm')))}}


Distance between two vertices:
Distance between two vertices:
Line 50: Line 52:
{{Code|code=Sketch.addConstraint(Sketcher.Constraint('DistanceX', Line, 1, Line, 2, App.Units.Quantity('123.0 mm')))}}
{{Code|code=Sketch.addConstraint(Sketcher.Constraint('DistanceX', Line, 1, Line, 2, App.Units.Quantity('123.0 mm')))}}


The [[Sketcher_scripting|Sketcher scripting]] page explains the values which can be used for {{incode|Edge1}}, {{incode|Edge2}}, {{incode|Edge}}, {{incode| PointOfEdge1}}, {{incode| PointOfEdge2}}, {{incode|PointOfEdge}} and {{incode|Line}}, and contains further examples on how to create constraints from Python scripts.
The [[Sketcher_scripting|Sketcher scripting]] page explains the values which can be used for {{incode|Edge}}, {{incode|Edge1}}, {{incode|Edge2}}, {{incode|PointOfEdge}}, {{incode| PointOfEdge1}}, {{incode| PointOfEdge2}} and {{incode|Line}}, and contains further examples on how to create constraints from Python scripts.





Revision as of 19:15, 4 April 2023

Distanza orizzontale

Posizione nel menu
Sketch → Vincolo → Distanza orizzontale
Ambiente
Sketcher
Avvio veloce
Maiusc + H
Introdotto nella versione
-
Vedere anche
Distanza, Distanza verticale

Descrizione

Fissa una distanza orizzontale tra due punti. È applicabile tra tutti i punti dello schizzo. Quando viene selezionato un solo punto la distanza è riferita all'origine.

Utilizzo

  1. Selezionare due punti o una linea
  2. Richiamare il comando in uno di questi modi:
    • Cliccare sull'icona Distanza orizzontale della barra degli strumenti.
    • Usare la scorciatoia da tastiera Maiusc + H.
    • Usare la voce Sketch → Vincoli → Distanza orizzontale dal menu principale.
  3. Si apre una finestra di dialogo per modificare o confermare il valore. Premere OK per confermare.

Nota: lo strumento di vincolo può essere avviato anche senza selezione precedente, ma richiede la selezione di due punti o una linea. Per impostare la distanza dall'origine, è necessario selezionare anche il punto di origine dello schizzo. Di default il comando è in modalità continua per creare nuovi vincoli; per uscire dal comando premere il tasto destro del mouse o una volta il tasto ESC.

Scripting

Distance from origin:

Sketch.addConstraint(Sketcher.Constraint('DistanceX', Edge, PointOfEdge, -1, 1, App.Units.Quantity('123.0 mm')))

Distance between two vertices:

Sketch.addConstraint(Sketcher.Constraint('DistanceX', Edge1, PointOfEdge1, Edge2, PointOfEdge2, App.Units.Quantity('123.0 mm')))

Horizontal span of line (the GUI allows selecting the edge itself, but it is just a shorthand for using the two extremities of the same line):

Sketch.addConstraint(Sketcher.Constraint('DistanceX', Line, 1, Line, 2, App.Units.Quantity('123.0 mm')))

The Sketcher scripting page explains the values which can be used for Edge, Edge1, Edge2, PointOfEdge, PointOfEdge1, PointOfEdge2 and Line, and contains further examples on how to create constraints from Python scripts.