Macro Dump Objects: Difference between revisions

From FreeCAD Documentation
No edit summary
No edit summary
Line 1: Line 1:
{{Macro|Icon=Macro_Dump_Objects|Name=Macro_Dump_Objects|Description=This macro generates a listing of all objects in the current document - the list can be in a window or on the Report view.|Author=PiffPoof}}
{{Macro|Icon=Macro_Dump_Objects|Name=Macro_Dump_Objects|Description=This macro generates a listing of all objects in the current document - the list can be in a window or on the Report view.|Author=PiffPoof}}

<!--T:18-->
[[File:DumpObjectsScreenSnapshot.jpg|500px]]

==Background== <!--T:2-->
When developing complex object models it is easy to loose 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== <!--T:3-->
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== <!--T:4-->
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.

==Usage== <!--T:5-->
Select the document you wish to dump objects for, then start the macro from either:
- 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== <!--T:6-->
The first window will take input which configures the Object Dump:
[[File:DumpObjectsGUI1.jpg|500px]]
The second window will be the report on the objects in the current document:
[[File:DumpObjectsScreenSnapshot.jpg|500px]]

Revision as of 20:30, 16 January 2015

File:Macro Dump Objects Macro_Dump_Objects

Description
This macro generates a listing of all objects in the current document - the list can be in a window or on the Report view.

Author: PiffPoof
Author
PiffPoof
Download
None
Links
Macro Version
1.0
Date last modified
None
FreeCAD Version(s)
None
Default shortcut
None
See also
None

Background

When developing complex object models it is easy to loose 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.

Usage

Select the document you wish to dump objects for, then start the macro from either: - 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: File:DumpObjectsGUI1.jpg The second window will be the report on the objects in the current document: