Draft AutoGroup/pt-br: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages/>
<languages/>


<div class="mw-translate-fuzzy">
{{Docnav
{{Docnav
|[[Draft_ToggleConstructionMode/pt-br|Modo de construção]]
|[[Draft_ToggleConstructionMode/pt-br|Modo de construção]]
|[[Draft_Snap_Lock/pt-br|Alternar tranca]]
|[[Draft_Snap_Lock/pt-br|Alternar tranca]]
|[[Draft_Module/pt-br|Draft]]
|[[Draft_Workbench/pt-br|Draft]]
|IconL=Draft_ToggleConstructionMode.svg
|IconL=Draft_ToggleConstructionMode.svg
|IconR=Draft_Snap_Lock.svg
|IconR=Draft_Snap_Lock.svg
|IconC=Workbench_Draft.svg
|IconC=Workbench_Draft.svg
}}
}}
</div>


{{GuiCommand
{{GuiCommand
|Name=Draft AutoGroup
|Name=Draft AutoGroup
|Empty=1
|MenuLocation=Utilities → AutoGroup
|Workbenches=[[Draft_Module|Draft]], [[Arch_Module|Arch]]
|Workbenches=[[Draft_Workbench|Draft]], [[Arch_Workbench|Arch]]
|Version=0.17
|Version=0.17
|SeeAlso=[[Draft_Layer|Draft Layer]], [[Std_Group|Std Group]]
|SeeAlso=[[Draft_Layer|Draft Layer]], [[Std_Group|Std Group]]
}}
}}


<span id="Description"></span>
== Descrição ==
== Descrição ==


The [[Image:Draft_AutoGroup.svg|24px]] '''Draft AutoGroup''' command changes the active [[Draft_Layer|Draft Layer]] or, [[#Preferences|optionally]], the active [[Std_Group|Std Group]] or group-like [[Arch_Module|Arch]] object. New [[Draft_Module|Draft]] and [[Arch_Module|Arch]] objects are automatically placed in this active layer or group.
The '''Draft AutoGroup''' command changes the active [[Draft_Layer|Draft Layer]] or, [[#Preferences|optionally]], the active [[Std_Group|Std Group]] or group-like [[Arch_Workbench|Arch]] object. New [[Draft_Workbench|Draft]] and [[Arch_Workbench|Arch]] objects are automatically placed in this active layer or group.


This command was originally intended for groups, hence its name, but was redesigned in FreeCAD version 0.19 when a layer system was introduced. Because handling layers is now the default for the command the rest of this page will primarily focus on layers.
This command was originally intended for groups, hence its name, but was redesigned in FreeCAD version 0.19 when a layer system was introduced. Because handling layers is now the default for the command the rest of this page will primarily focus on layers.
Line 27: Line 30:
{{Caption|The layer menu of the Draft Tray}}
{{Caption|The layer menu of the Draft Tray}}


<span id="Usage"></span>
==Utilização==
==Utilização==


# To use this command in FreeCAD version 0.19 at least one [[Draft_Layer|Draft Layer]] must exist.
# Optionally select the layer you want to make active in the [[Tree_view|Tree view]].
# Optionally select the layer you want to make active in the [[Tree_view|Tree view]].
# There are several ways to invoke the command:
# There are several ways to invoke the command:
#* Press the {{Button|[[Image:button_invalid.svg|16px]] [[Draft_AutoGroup|None]]}} button in the [[Draft_Tray|Draft Tray]]. This button can look different. If there is an active layer it will show the name of the layer and a layer icon with the {{PropertyView|Line Color}} and {{PropertyView|Shape Color}} of the layer.
#* Press the [[Image:Draft_tray_button_layer.png]] button in the [[Draft_Tray|Draft Tray]]. This button can look different. If there is an active layer it will show the name of the layer and a layer icon with the {{PropertyView|Line Color}} and {{PropertyView|Shape Color}} of the layer.
#* Select the {{MenuCommand|Utilities → [[Image:Draft_AutoGroup.svg|16px]] AutoGroup}} option from the menu.
#* If you have selected a layer: select the {{MenuCommand|[[Image:button_right.svg|16px]] Activate this layer}} option from the [[Tree_view|Tree view]] context menu.
# If you have not yet selected a layer the layer menu opens. Do one of the following:
# If you have not yet selected a layer the layer menu opens. Do one of the following:
#* Select {{MenuCommand|None}} to work without an active layer.
#* Select {{MenuCommand|None}} to work without an active layer.
Line 40: Line 43:
# If the active layer was changed the button in the [[Draft_Tray|Draft Tray]] is updated.
# If the active layer was changed the button in the [[Draft_Tray|Draft Tray]] is updated.


<span id="Notes"></span>
==Notas==
==Notas==


* A new [[Draft_Layer|layer]] can also be created by right-clicking the layer container in the [[Tree_view|Tree view]] and selecting the {{MenuCommand|[[Image:Draft_NewLayer.svg|16px]] Add new layer}} option from the context menu.
* If [[Draft ToggleConstructionMode|Draft construction mode]] is switched on the active [[Draft_Layer|Draft Layer]] is ignored.
* If [[Draft_ToggleConstructionMode|Draft construction mode]] is switched on the active [[Draft_Layer|layer]] is ignored.


<span id="Preferences"></span>
==Preferências==
==Preferências==


See also: [[Preferences_Editor|Preferences Editor]] and [[Draft_Preferences|Draft Preferences]].
See also: [[Preferences_Editor|Preferences Editor]] and [[Draft_Preferences|Draft Preferences]].


* This command can optionally also handle groups: {{MenuCommand|Edit → Preferences... → Draft → General settingsGeneral Draft Settings → Show groups in layers list drop-down button}}.
* This command can optionally also handle groups: {{MenuCommand|Edit → Preferences... → Draft → General → Include groups in layer list}}.


== Scripting ==
== Scripting ==


See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].


If the [[Draft_Module|Draft Workbench]] is active the FreeCADGui application object has a {{incode|draftToolBar}} property. This {{incode|draftToolBar}} object has an {{incode|autogroup}} property, which contains the name of the active autogroup, or is {{incode|None}} if no autogroup is active. To change the active autogroup use the {{incode|setAutoGroup}} method of the {{incode|draftToolBar}} object. To put objects in the active autogroup use the {{incode|autogroup}} method of the Draft module.
If the [[Draft_Workbench|Draft Workbench]] is active the FreeCADGui application object has a {{incode|draftToolBar}} property. This {{incode|draftToolBar}} object has an {{incode|autogroup}} property, which contains the name of the active autogroup, or is {{incode|None}} if no autogroup is active. To change the active autogroup use the {{incode|setAutoGroup}} method of the {{incode|draftToolBar}} object. To put objects in the active autogroup use the {{incode|autogroup}} method of the Draft module.


{{Code|code=
{{Code|code=
Line 80: Line 86:




<div class="mw-translate-fuzzy">
{{Docnav
{{Docnav
|[[Draft_ToggleConstructionMode/pt-br|Modo de construção]]
|[[Draft_ToggleConstructionMode/pt-br|Modo de construção]]
|[[Draft_Snap_Lock/pt-br|Alternar tranca]]
|[[Draft_Snap_Lock/pt-br|Alternar tranca]]
|[[Draft_Module/pt-br|Draft]]
|[[Draft_Workbench/pt-br|Draft]]
|IconL=Draft_ToggleConstructionMode.svg
|IconL=Draft_ToggleConstructionMode.svg
|IconR=Draft_Snap_Lock.svg
|IconR=Draft_Snap_Lock.svg
|IconC=Workbench_Draft.svg
|IconC=Workbench_Draft.svg
}}
}}
</div>


{{Draft Tools navi{{#translation:}}}}
{{Draft Tools navi{{#translation:}}}}

Latest revision as of 19:58, 7 December 2023

Draft AutoGroup

Menu location
None
Workbenches
Draft, Arch
Default shortcut
None
Introduced in version
0.17
See also
Draft Layer, Std Group

Descrição

The Draft AutoGroup command changes the active Draft Layer or, optionally, the active Std Group or group-like Arch object. New Draft and Arch objects are automatically placed in this active layer or group.

This command was originally intended for groups, hence its name, but was redesigned in FreeCAD version 0.19 when a layer system was introduced. Because handling layers is now the default for the command the rest of this page will primarily focus on layers.

The layer menu of the Draft Tray

Utilização

  1. Optionally select the layer you want to make active in the Tree view.
  2. There are several ways to invoke the command:
    • Press the button in the Draft Tray. This button can look different. If there is an active layer it will show the name of the layer and a layer icon with the VistaLine Color and VistaShape Color of the layer.
    • If you have selected a layer: select the Activate this layer option from the Tree view context menu.
  3. If you have not yet selected a layer the layer menu opens. Do one of the following:
    • Select None to work without an active layer.
    • Select an existing layer to make active.
    • Select Add new Layer to create a new layer. Selecting this option will not change the active layer.
  4. If the active layer was changed the button in the Draft Tray is updated.

Notas

  • A new layer can also be created by right-clicking the layer container in the Tree view and selecting the Add new layer option from the context menu.
  • If Draft construction mode is switched on the active layer is ignored.

Preferências

See also: Preferences Editor and Draft Preferences.

  • This command can optionally also handle groups: Edit → Preferences... → Draft → General → Include groups in layer list.

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

If the Draft Workbench is active the FreeCADGui application object has a draftToolBar property. This draftToolBar object has an autogroup property, which contains the name of the active autogroup, or is None if no autogroup is active. To change the active autogroup use the setAutoGroup method of the draftToolBar object. To put objects in the active autogroup use the autogroup method of the Draft module.

# This code only works if the Draft Workbench is active!

import FreeCAD as App
import FreeCADGui as Gui
import Draft

doc = App.newDocument()

polygon1 = Draft.make_polygon(5, radius=1000)
polygon2 = Draft.make_polygon(3, radius=500)
polygon3 = Draft.make_polygon(6, radius=220)

layer = Draft.make_layer()
Gui.draftToolBar.setAutoGroup(layer.Name)

Draft.autogroup(polygon1)
Draft.autogroup(polygon2)
Draft.autogroup(polygon3)

doc.recompute()