Sandbox:Piffpoof6

From FreeCAD Documentation
Jump to: navigation, search

Group in FreeCAD

Introduction

Object models are constructed in FreeCAD by adding objects incrementally. A model may have arbitrary levels of complexityin FreeCAD. As models become more complex, it is useful to be able to gather related objects together in order to better manage the complete object model.

Background

In FreeCAD all objects in a document are in a flat hierarchy. This means that there is a list of the objects, sorted by Object Name, but there are no higher or level objects, there is no hierarchy. To provide the ability to gather and collect similar objects together, FreeCAD has the concept of "Group". Groups are special objects that only keeps a list of pointers to other objects of this document. They are effectively both lists of other objects as well as objects themselves. Aside from a group being a member of itself, it can be a member of any other group which it does not contain.

GUI Access

Probably the most common interaction with the FreeCAD Group is through the Graphic User Interface (GUI). ...

  • hide/display
  • drag/drop
  • delete (children to)
  • select all members of group

Python Access

To access the child objects of a group you have to:

 grp=App.ActiveDocument.getObject("Name of the group").OutList
 for i in grp:
   ...
 
  • iterate
  • list members
  • delete member
  • add member