Macro Wiki Object Properties List Generator Basic Version

Description
This simple macro generate properties list of selected object. The parameters list is printed to the Report view of FreeCAD. This example is more educational in nature and is not applicable for use without editing after generate, since it includes absolutely all the parameters of the object. The lists of properties that are published in this wiki contain, as a rule, only unique parameters. The parameters inherited from the parents objects are not published.

Usage

 * Preparing:
 * Copy code of Macro from this page and place it in a new *.FCMacro file.
 * Save FCMacro file, and place it in the FreeCAD Macros folder.
 * Disable Include a timecode for each entry checkbox in Preferences -> General -> Output window (Tab).
 * First using:
 * Select (or create and select) object the type of you need in tree view.
 * Select Macro -> Macros... item in main menu.
 * In opened window find *.FCMacro file what you save letter and press Execute Button.
 * How to use again:
 * To quickly run this macro again, you can use keyboard shortcut Shift+Ctrl+1 (on Windows) it will launch the last run macro.

Recommendations
Do not delete spaces between lines. This is necessary to simplify the translation. Each line separated by a space will be considered a separate part for translation. When creating texts, always remember that large monolithic fragments of text are difficult for translators to translate.

Example of using

 * For example open the Arch Workbench
 * Create a Structure object.
 * Select the created Structure object.
 * Run the macro.
 * Copy the text from the report view and paste it in a wiki page and check the result.

Results of using
The results may look like this:

View



 * : Use the material color as this object's shape color, if available


 * : Display object bounding box


 * : Set the display mode


 * : Show the object in the tree view


 * : Show the object in the 3d view


 * : The color of the nodes line


 * : The width of the nodes line


 * : The size of the node points


 * : The type of structural node


 * : If the nodes are visible or not

The default value is 28.5 degrees, or 0.5 radians. The smaller the value the smoother the appearance in the 3D view, and the finer the mesh that will be exported.
 * : Specify how finely to generate the mesh for rendering on screen or when exporting.

in the 3D view (tessellation). Lower values indicate better quality. The value is in percent of object's size.
 * : Sets the accuracy of the polygonal representation of the model


 * : Object diffuse color.


 * : Defines the style of the edges in the 3D view.


 * : Set object lighting.


 * : Set object line color.


 * : Object line color array.


 * : Object line material.


 * : Set object line width.


 * : Set object point color


 * : Object point color array.


 * : Object point material.


 * : Set object point size.


 * : Set shape color


 * : Shape material


 * : Set object transparency

Object: On top only if the whole object is selected Element: On top only if some sub-element of the object is selected
 * : Enabled: Display the object on top of any other object when selected


 * : Set if the object is selectable in the 3d view


 * : Set the object selection style

Data









 * : Property expressions


 * : User name of the object (UTF8)


 * : User description of the object (UTF8)


 * : Other shapes that are appended to this object


 * : An optional axis or axis system on which this object should be duplicated


 * : The base object this component is built upon


 * : The object this component is cloning


 * : An optional higher-resolution mesh or shape for this object


 * : The area of the projection of this object onto the XY plane


 * : A material for this object


 * : Specifies if moving this object moves its base instead


 * : Specifies if this object must move together when its host is moved


 * : The perimeter length of the horizontal area


 * : An optional standard (OmniClass, etc...) code for this component


 * : Other shapes that are subtracted from this object


 * : The area of all vertical faces of this object


 * : IFC data


 * : IFC properties of this object


 * : The type of this object


 * : Description of IFC attributes are not yet implemented


 * : Description of IFC attributes are not yet implemented


 * : Description of IFC attributes are not yet implemented


 * : Description of IFC attributes are not yet implemented


 * : Description of IFC attributes are not yet implemented


 * : The facemaker type to use to build the profile of this object


 * : The height or extrusion depth of this element. Keep 0 for automatic


 * : The length of this element, if not based on a profile


 * : The structural nodes of this element


 * : Offset distance between the centerline and the nodes line


 * : The normal extrusion direction of this object (keep (0,0,0) for automatic normal)


 * : A description of the standard profile this element is based upon


 * : An optional extrusion path for this element


 * : The width of this element, if not based on a profile

Script
{{MacroCode|code= from FreeCAD import Qt
 * 1) ! python
 * 2) -*- coding: utf-8 -*-
 * 3) (c) 2021 < Evgeniy > LG

def print_obj_properties(obj,typ): prop={} i=1 for pr in obj.PropertiesList: tp = obj.getTypeIdOfProperty(pr) or "" atr = obj.getTypeOfProperty(pr) or ("") # Wiki template supports only Hidden type of property. But it can be as: Hidden,Output,Readonly etc... if atr != "" and atr[0] == "Hidden": atr = "|"+atr[0] else: atr = "" prop[str(i)] = pr,obj.getGroupOfProperty(pr),tp.replace("App::Property",""),obj.getDocumentationOfProperty(pr),atr i+=1 sorted_prop = sorted(prop.items, key=lambda x: x[1][1])

title="" for pr in sorted_prop: if title != pr[1][1]: title = pr[1][1] print("\n"+"{{TitleProperty{"+title+"}}") print("\n"+"* {{Property"+typ+"{"+pr[1][0]+"{"+pr[1][2]+pr[1][4]+"}}: "+pr[1][3])

print("\n"+"==Properties==") print("\n"+"===View===") obj = Gui.activeDocument.ActiveObject print_obj_properties(obj,"View") print("\n"+"===Data===") obj = FreeCAD.activeDocument.ActiveObject print_obj_properties(obj,"Data") }}

Links
The discussion on the forum: https://forum.freecadweb.org/viewtopic.php?f=21&t=61998