Rysunek Roboczy: Grupowanie automatyczne

From FreeCAD Documentation
Revision as of 19:42, 25 December 2023 by Kaktus (talk | contribs) (Created page with "{{Caption|Menu warstw w tacce narzędziowej.}}")

Rysunek Roboczy: Grupowanie automatyczne

Lokalizacja w menu
brak
Środowisko pracy
Rysunek Roboczy, Architektura
Domyślny skrót
brak
Wprowadzono w wersji
0.17
Zobacz także
Warstwa, Grupa

Opis

Polecenie Grupowanie automatyczne zmienia aktywną warstwę lub, opcjonalnie, aktywną grupę lub podobny do grupy obiekt architektury. Nowe obiekty Rysunku roboczego i Architrktury są automatycznie umieszczane w tej aktywnej warstwie lub grupie.

Polecenie to było pierwotnie przeznaczone dla grup, stąd jego nazwa, ale zostało przeprojektowane w wersji FreeCAD 0.19, kiedy wprowadzono system warstw. Ponieważ obsługa warstw jest teraz domyślna dla polecenia, pozostała część tej strony skupi się głównie na warstwach.

Menu warstw w tacce narzędziowej.

Użycie

  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 WIDOKLine Color and WIDOKShape 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.

Uwagi

  • 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.

Ustawienia

Zobacz także strony: Edytor ustawień oraz Rysunek Roboczy: Ustawienia.

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

Tworzenie skryptów

Zobacz również stronę: Dokumentacja API generowana automatycznie oraz Podstawy pisania skryptów dla FreeCAD.

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()