Description |
---|
This macro generate properties list of selected object. List presented in wiki format into Python report view. Macro version: 0.1 Last modified: 2021-09 Author: Evgeniy |
Author |
Evgeniy |
Download |
None |
Links |
Macros recipes How to install macros How to customize toolbars |
Macro Version |
0.1 |
Date last modified |
2021-09 |
FreeCAD Version(s) |
None |
Default shortcut |
None |
See also |
Macro Wiki Object Properties List Generator |
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.
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.
The results may look like this:
PythonObject
):Component
Bool
): Use the material color as this object's shape color, if availableDisplay Options
Bool
): Display object bounding boxEnumeration
): Set the display modeBool
): Show the object in the tree viewBool
): Show the object in the 3d viewNodes
Color
): The color of the nodes lineFloat
): The width of the nodes lineFloat
): The size of the node pointsEnumeration
): The type of structural nodeBool
): If the nodes are visible or notObject Style
Angle
): Specify how finely to generate the mesh for rendering on screen or when exporting.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.
FloatConstraint
): Sets the accuracy of the polygonal representation of the modelin the 3D view (tessellation). Lower values indicate better quality. The value is in percent of object's size.
ColorList
): Object diffuse color.Enumeration
): Defines the style of the edges in the 3D view.Enumeration
): Set object lighting.Color
): Set object line color.ColorList
): Object line color array.Material
): Object line material.FloatConstraint
): Set object line width.Color
): Set object point colorColorList
): Object point color array.Material
): Object point material.FloatConstraint
): Set object point size.Color
): Set shape colorMaterial
): Shape materialPercent
): Set object transparencySelection
Enumeration
): Enabled: Display the object on top of any other object when selectedObject: On top only if the whole object is selected Element: On top only if some sub-element of the object is selected
Bool
): Set if the object is selectable in the 3d viewEnumeration
): Set the object selection stylePlacement
):PythonObject
):Part::PropertyPartShape
):Bool
):Base
ExpressionEngine
): Property expressionsString
): User name of the object (UTF8)String
): User description of the object (UTF8)Component
LinkList
): Other shapes that are appended to this objectLink
): An optional axis or axis system on which this object should be duplicatedLink
): The base object this component is built uponLink
): The object this component is cloningLink
): An optional higher-resolution mesh or shape for this objectArea
): The area of the projection of this object onto the XY planeLink
): A material for this objectBool
): Specifies if moving this object moves its base insteadBool
): Specifies if this object must move together when its host is movedLength
): The perimeter length of the horizontal areaString
): An optional standard (OmniClass, etc...) code for this componentLinkList
): Other shapes that are subtracted from this objectArea
): The area of all vertical faces of this objectIFC
Map
): IFC dataMap
): IFC properties of this objectEnumeration
): The type of this objectIFC Attributes
String
): Description of IFC attributes are not yet implementedString
): Description of IFC attributes are not yet implementedString
): Description of IFC attributes are not yet implementedEnumeration
): Description of IFC attributes are not yet implementedString
): Description of IFC attributes are not yet implementedStructure
Enumeration
): The facemaker type to use to build the profile of this objectLength
): The height or extrusion depth of this element. Keep 0 for automaticLength
): The length of this element, if not based on a profileVectorList
): The structural nodes of this elementDistance
): Offset distance between the centerline and the nodes lineVector
): The normal extrusion direction of this object (keep (0,0,0) for automatic normal)String
): A description of the standard profile this element is based uponLink
): An optional extrusion path for this elementLength
): The width of this element, if not based on a profile#! python # -*- coding: utf-8 -*- # (c) 2021 <Evgeniy> LG from FreeCAD import Qt 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")
The discussion on the forum: https://forum.freecadweb.org/viewtopic.php?f=21&t=61998