Std: Grupa

From FreeCAD Documentation
Revision as of 08:03, 21 May 2023 by Kaktus (talk | contribs) (Created page with "Ten podstawowy obiekt {{incode|App::DocumentObjectGroup}} nie posiada obiektu Proxy, więc nie może być w pełni wykorzystany do tworzenia klas podrzędnych.")

Std: Grupa

Lokalizacja w menu
Widok drzewa → Kliknij prawym przyciskiem myszki nazwę dokumentu → Utwórz grupę ...
Środowisko pracy
wszystkie
Domyślny skrót
brak
Wprowadzono w wersji
-
Zobacz także
Część, Wybierz grupę, Dodaj do grupy

Opis

Std Group (internally called App DocumentObjectGroup) is a general purpose container that allows you to group different types of objects in the Tree view, regardless of their data type. It is used as a simple folder to categorize and organize the objects in your model, in order to keep a logical structure. Std Groups may be nested inside other Std Groups.

The Std Group tool is not defined by a particular workbench, but by the base system, thus it is found in the structure toolbar that is available in all workbenches.

To group 3D objects as a single unit, with the intention of creating assemblies, use Std Part instead.

Various elements inside Std Groups in the tree view.

Użycie

  1. Do one of the following:
    • Right-click the name of the document in the Tree view and in the context menu choose Create group....
    • Press the Create group button.
  2. An empty Group is created.
  3. To add objects to the Group, select them in Tree view, and drag and drop them onto the Group.
  4. To remove objects from the Group, drag them out of the Group, and onto the document label at the top of the Tree view.
  5. Objects can also be added and removed by editing the DANEGroup property of the Group.

Właściwości

The Std Group, internally called App DocumentObjectGroup (App::DocumentObjectGroup class), is derived from the basic App DocumentObject (App::DocumentObject class) and inherits all its properties.

The Std Group has the same properties as the App FeaturePython, which is the most basic instance of an App DocumentObject. It also has the following additional properties in the property editor. Hidden properties can be shown by using the Show all command in the context menu of the property editor.

Dane

Podstawowe

  • DANEGroup (LinkList): a list of referenced objects. By default, it is empty [].
  • DANE (Hidden)_ Group Touched (Bool): whether the group is touched or not.

Tworzenie skryptów

Zobacz również: Podstawy tworzenia skryptów FreeCAD, oraz Obiekty skryptowe.

Ogólne informacje na temat dodawania obiektów do dokumentu można znaleźć na stronie Część: właściwość.

Element Std: Grupa (App DocumentObjectGroup) jest tworzony przy pomocy metody addObject() dokumentu. Gdy istnieje element Part, inne obiekty mogą być do niego dodane za pomocą metod addObject() lub addObjects() tej Części.

import FreeCAD as App

doc = App.newDocument()
group = App.ActiveDocument.addObject("App::DocumentObjectGroup", "Group")

obj1 = App.ActiveDocument.addObject("PartDesign::Body", "Body")
obj2 = App.ActiveDocument.addObject("Part::Box", "Box")

group.addObjects([obj1, obj2])
App.ActiveDocument.recompute()

Ten podstawowy obiekt App::DocumentObjectGroup nie posiada obiektu Proxy, więc nie może być w pełni wykorzystany do tworzenia klas podrzędnych.

For Python subclassing you should create a App::DocumentObjectGroupPython object.

import FreeCAD as App

doc = App.newDocument()
obj = App.ActiveDocument.addObject("App::DocumentObjectGroupPython", "Name")
obj.Label = "Custom label"

For example, a FEM Analysis is an App::DocumentObjectGroupPython object with a custom icon and additional properties.

Links