Draft AutoGroup: Difference between revisions
m (→) |
m (png to svg) |
||
(25 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
⚫ | |||
<translate> |
<translate> |
||
<!--T:14--> |
|||
{{Docnav |
|||
|[[Draft Slope|Slope]] |
|||
|[[Draft SetWorkingPlaneProxy|Set Working Plane Proxy]] |
|||
|[[Draft_Module|Draft]] |
|||
|IconL=Draft_Slope.svg |
|||
|IconC=Workbench_Draft.svg |
|||
|IconR=Draft_SetWorkingPlaneProxy.svg |
|||
}} |
|||
<!--T:1--> |
<!--T:1--> |
||
{{GuiCommand |
|||
{{GuiCommand|Name=Draft AutoGroup|Workbenches=[[Draft Module|Draft]], [[Arch Module|Arch]]|MenuLocation=Draft → Utilities → AutoGroup|SeeAlso=}} |
|||
|Name=Draft AutoGroup |
|||
|MenuLocation=Draft → Utilities → AutoGroup |
|||
|Workbenches=[[Draft Module|Draft]], [[Arch Module|Arch]] |
|||
|SeeAlso=[[Std Group|Std Group]], [[Draft VisGroup|Draft VisGroup]] |
|||
|Version=0.17 |
|||
}} |
|||
⚫ | |||
<!--T:2--> |
|||
⚫ | The AutoGroup tool sets a selected [[Std Group|Std Group]], or a related element like a [[Draft VisGroup|Draft VisGroup]], [[Arch Site|Arch Site]], [[Arch Building|Arch Building]] or [[Arch BuildingPart|Arch BuildingPart]], as the active auto-group. When an auto-group is set, new objects will be automatically moved to the indicated group upon being created. |
||
<!--T:8--> |
|||
Auto-grouping works with elements created with the [[Draft Workbench|Draft]] and [[Arch Workbench|Arch Workbenches]]. |
|||
</translate> |
</translate> |
||
[[Image:Draft_AutoGroup_example. |
[[Image:Draft_AutoGroup_example.png]] |
||
<translate> |
<translate> |
||
<!--T:9--> |
|||
{{Caption|Draft Tray which sets the active auto-group by clicking on the folder icon and choosing a group}} |
|||
== |
==Usage== <!--T:18--> |
||
⚫ | |||
<!--T:3--> |
|||
# Select |
# Select a {{Button|[[Image:Group.svg|16px]] [[Std Group|Std Group]]}}, {{Button|[[Image:Group.svg|16px]] [[Draft_ToggleConstructionMode|Construction group]]}}, or {{Button|[[Image:Draft_VisGroup.svg|16px]] [[Draft VisGroup|Draft VisGroup]]}} in the tree view. |
||
# Press the {{Button|[[Image:Draft AutoGroup_off.svg|16px]] None}} button, or go to the menu {{MenuCommand|Draft → Utilities → [[Image:Draft AutoGroup.svg|16px]] [[Draft AutoGroup|AutoGroup]]}}. If no group is selected, a drop-down menu will display eligible groups to use, or "None". |
|||
# Choose the desired group in the drop-down box |
|||
# The button will change with the name of the active auto-group, for example, {{Button|[[Image:Draft AutoGroup_on.svg|16px]] Group}}. |
|||
⚫ | |||
<!--T:5--> |
<!--T:5--> |
||
Notes: |
|||
* When AutoGroup is set, the button turns green, it means autogrouping is activated. You can click on it to change the group or unset. |
|||
* The {{Button|[[Image:Draft AutoGroup.svg|16px]] [[Draft AutoGroup|AutoGroup]]}} button is present in the [[Draft Tray|Draft Tray]] toolbar, which only appears in the [[Draft Workbench|Draft]] and [[Arch Workbench|Arch Workbench]]es. |
|||
* When autogrouping is active, any new Draft or Arch object created will be placed in that group (except when Draft construction mode is on, in which case it goes to the construction group). |
|||
* At least one of {{Button|[[Image:Group.svg|16px]] [[Std Group|Std Group]]}}, {{Button|[[Image:Group.svg|16px]] [[Draft_ToggleConstructionMode|Construction group]]}}, or {{Button|[[Image:Draft_VisGroup.svg|16px]] [[Draft VisGroup|Draft VisGroup]]}} must exist before using this tool. |
|||
* This only works when creating Draft or Arch objects from the GUI buttons. Not when using them from python. This is so it is still possible for python scripts to do the grouping they want, regardless of what autogrouping says. |
|||
* To change the auto-group, select another group in the tree view and click {{Button|[[Image:Draft AutoGroup_on.svg|16px]] Group}}. If no group is selected you have the option of choosing "None" to turn off auto-grouping. |
|||
* When auto-grouping is active, new [[Draft Workbench|Draft]] and [[Arch Workbench|Arch]] objects will be placed in that group except when {{Button|[[Image:Draft Construction.svg|16px]] [[Draft_ToggleConstructionMode|Construction mode]]}} is on, in which case the new geometry will be placed in the Construction group. |
|||
* Auto-grouping only works for objects created from the graphical user interface; objects created programmatically by [[macros|macros]] or the [[Python|Python]] console aren't automatically placed in groups. The user always has the possibility of programmatically doing the grouping, regardless of the auto-grouping settings. |
|||
== Scripting == <!--T:6--> |
== Scripting == <!--T:6--> |
||
<!--T:10--> |
|||
{{Emphasis|See also:}} [[Draft API|Draft API]] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]]. |
|||
<!--T:7--> |
<!--T:7--> |
||
Adding objects to the active auto-group can be done in [[macros|macros]] and from the [[Python|Python]] console by using the following function: |
|||
In python scripts, using Draft autogrouping is simply done with the command below: |
|||
</translate> |
|||
{{Code|code= |
|||
⚫ | |||
}} |
|||
<translate> |
|||
<!--T:11--> |
|||
* Puts the {{incode|obj}} element in the current auto-group. |
|||
* If auto-grouping is disabled (the group is {{incode|None}}), or if [[Draft_ToggleConstructionMode|Construction mode]] is active, or if {{incode|obj}} is already in the auto-group, the function doesn't do anything. |
|||
* The function will fail if {{incode|obj}} is already in another group that is different from the auto-group. |
|||
* The function only does something if the graphical interface is active, as the auto-group can only be chosen from the graphical interface. |
|||
<!--T:12--> |
|||
Example: |
|||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
import Draft |
import FreeCAD, Draft |
||
⚫ | |||
Polygon1 = Draft.makePolygon(3, 500) |
|||
Polygon2 = Draft.makePolygon(3, 1000) |
|||
Polygon3 = Draft.makePolygon(5, 1500) |
|||
FreeCAD.ActiveDocument.addObject("App::DocumentObjectGroup", "Group") |
|||
# Use the graphical interface to set "Group" for auto-grouping |
|||
Draft.autogroup(Polygon1) |
|||
Draft.autogroup(Polygon2) |
|||
Draft.autogroup(Polygon3) |
|||
}} |
}} |
||
<translate> |
|||
<!--T:13--> |
|||
⚫ | |||
{{Docnav |
|||
|[[Draft Slope|Slope]] |
|||
|[[Draft SetWorkingPlaneProxy|Set Working Plane Proxy]] |
|||
|[[Draft_Module|Draft]] |
|||
|IconL=Draft_Slope.svg |
|||
|IconC=Workbench_Draft.svg |
|||
|IconR=Draft_SetWorkingPlaneProxy.svg |
|||
}} |
|||
</translate> |
|||
{{Draft Tools navi{{#translation:}}}} |
|||
{{Userdocnavi{{#translation:}}}} |
|||
{{clear}} |
Revision as of 17:32, 14 April 2020
Draft AutoGroup |
Menu location |
---|
Draft → Utilities → AutoGroup |
Workbenches |
Draft, Arch |
Default shortcut |
None |
Introduced in version |
0.17 |
See also |
Std Group, Draft VisGroup |
Description
The AutoGroup tool sets a selected Std Group, or a related element like a Draft VisGroup, Arch Site, Arch Building or Arch BuildingPart, as the active auto-group. When an auto-group is set, new objects will be automatically moved to the indicated group upon being created.
Auto-grouping works with elements created with the Draft and Arch Workbenches.
File:Draft AutoGroup example.png
Draft Tray which sets the active auto-group by clicking on the folder icon and choosing a group
Usage
- Select a Std Group, Construction group, or Draft VisGroup in the tree view.
- Press the None button, or go to the menu Draft → Utilities → AutoGroup. If no group is selected, a drop-down menu will display eligible groups to use, or "None".
- The button will change with the name of the active auto-group, for example, Group.
Notes:
- The AutoGroup button is present in the Draft Tray toolbar, which only appears in the Draft and Arch Workbenches.
- At least one of Std Group, Construction group, or Draft VisGroup must exist before using this tool.
- To change the auto-group, select another group in the tree view and click Group. If no group is selected you have the option of choosing "None" to turn off auto-grouping.
- When auto-grouping is active, new Draft and Arch objects will be placed in that group except when Construction mode is on, in which case the new geometry will be placed in the Construction group.
- Auto-grouping only works for objects created from the graphical user interface; objects created programmatically by macros or the Python console aren't automatically placed in groups. The user always has the possibility of programmatically doing the grouping, regardless of the auto-grouping settings.
Scripting
See also: Draft API and FreeCAD Scripting Basics.
Adding objects to the active auto-group can be done in macros and from the Python console by using the following function:
autogroup(obj)
- Puts the
obj
element in the current auto-group. - If auto-grouping is disabled (the group is
None
), or if Construction mode is active, or ifobj
is already in the auto-group, the function doesn't do anything. - The function will fail if
obj
is already in another group that is different from the auto-group. - The function only does something if the graphical interface is active, as the auto-group can only be chosen from the graphical interface.
Example:
import FreeCAD, Draft
Polygon1 = Draft.makePolygon(3, 500)
Polygon2 = Draft.makePolygon(3, 1000)
Polygon3 = Draft.makePolygon(5, 1500)
FreeCAD.ActiveDocument.addObject("App::DocumentObjectGroup", "Group")
# Use the graphical interface to set "Group" for auto-grouping
Draft.autogroup(Polygon1)
Draft.autogroup(Polygon2)
Draft.autogroup(Polygon3)
Draft
- Drafting: Line, Polyline, Fillet, Arc, Arc by 3 points, Circle, Ellipse, Rectangle, Polygon, B-spline, Cubic Bézier curve, Bézier curve, Point, Facebinder, ShapeString, Hatch
- Annotation: Text, Dimension, Label, Annotation styles, Annotation scale
- Modification: Move, Rotate, Scale, Mirror, Offset, Trimex, Stretch, Clone, Array, Polar array, Circular array, Path array, Path link array, Point array, Point link array, Edit, Subelement highlight, Join, Split, Upgrade, Downgrade, Wire to B-spline, Draft to sketch, Set slope, Flip dimension, Shape 2D view
- Draft Tray: Select plane, Set style, Toggle construction mode, AutoGroup
- Snapping: Snap lock, Snap endpoint, Snap midpoint, Snap center, Snap angle, Snap intersection, Snap perpendicular, Snap extension, Snap parallel, Snap special, Snap near, Snap ortho, Snap grid, Snap working plane, Snap dimensions, Toggle grid
- Miscellaneous: Apply current style, Layer, Manage layers, Add a new named group, Move to group, Select group, Add to construction group, Toggle normal/wireframe display, Create working plane proxy, Heal, Show snap toolbar
- Additional: Constraining, Pattern, Preferences, Import Export Preferences, DXF/DWG, SVG, OCA, DAT
- Context menu:
- Layer container: Merge layer duplicates, Add new layer
- Layer: Activate this layer, Select layer contents
- Text: Open hyperlinks
- Wire: Flatten
- Working plane proxy: Write camera position, Write objects state
User documentation
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Start, Surface, TechDraw, Test Framework, Web
- Hubs: User hub, Power users hub, Developer hub