Macro Dump Objects

When developing complex object models it is easy to lose track of exactly which objects are present as some may be hidden, obscured or transparent. Additionally with a large number of objects a naming system becomes necessary to keep track of the objects.



Description
The Dump Object code takes the current document and enumerates all the objects. A report is then generated listing each object, then a summary giving the total number of instances of each Class, followed by the total number of Classes and finally the total number of objects. The output may be directed to the Report view or to a window. The window is non-modal and will stay open until closed by the user. Each window has the time of the object dump in it's title bar, so the contents of multiple windows can be compared, say before and after a piece of code running.

The default operation lists all objects, optionally the placement of each object can be listed. Also for Sketches, each segment of the Geometry can be listed.

Installation
All the code for dumpObject.FCMacro is in one macro. So installation is comprised of copying the code to the appropriate Macro directory and invoking dumpObject from the Macro menu. Alternatively it may be run from the console.
 * see How to install macros for information on how to install this macro code
 * see Customize Toolbars for information how to install as a button on a toolbar

Usage
Select the document you wish to dump objects for, then start the macro from one of:
 * the Macro menu
 * from the Python console
 * from a Toolbar

Depending on the parameters selected in the first window, the report will be displayed on the Report view or in a window. The information will show all objects in the current document. Some of the benefits to be expected are the detection of:


 * irregularities in object names (e.g. spelling errors or default names generated by FreeCAD)
 * duplicate objects
 * objects with duplicate names (where FreeCAD has had to make the second object name unique)
 * unexpected objects
 * unexpected object Placements (when the Show Positions option is selected)
 * unexpected segments in the Sketch Geometry (when the Show Sketcher Segments option is selected)

User Interface
The first window will take input which configures the Object Dump:



The second window will be the report on the objects in the current document:



Options

 * output may be directed to one of:
 * the Report view
 * a non-modal window
 * segments in the Geometry for each Sketch may be listed
 * Placement specifics may be listed for objects

Remarks
Although tested with many object types in FreeCAD, there probably are some objects that it does not expect, in that case it should list them generically.

Script
Toolbar Icon



Macro_Dump_Objects.FCMacro