| Beschreibung |
|---|
| Dieses Makro generiert eine Liste der Eigenschaften des ausgewählten Objekts. Die Liste wird im Wiki-Format in der Python-Berichtsansicht dargestellt. Versionsmakro : 0.1 Datum der letzten Änderung : 2021-09 Autor: Evgeniy |
| Autor |
| Evgeniy |
| Herunterladen |
| None |
| Links |
| Makros Rezepte Wie man Makros installiert Symbolleisten anpassen |
| Macro-Version |
| 0.1 |
| Datum der letzten Änderung |
| 2021-09 |
| FreeCAD-Version(s) |
| None |
| Standardverknüpfung |
| None |
| Siehe auch |
| Makro Wiki-Objekteigenschaften-Listen-Generator |
Dieses einfache Makro generiert eine Liste der Eigenschaften des ausgewählten Objekts. Die Parameterliste wird in der Ausgabefenster von FreeCAD ausgegeben. Dieses Beispiel dient eher zu Schulungszwecken und ist ohne Nachbearbeitung nach der Generierung nicht verwendbar, da es absolut alle Parameter des Objekts enthält. Die in diesem Wiki veröffentlichten Eigenschaftslisten enthalten in der Regel nur eindeutige Parameter. Die von den übergeordneten Objekten geerbten Parameter werden nicht veröffentlicht.
Keine Leerzeichen zwischen den Zeilen löschen. Dies ist notwendig, um die Übersetzung zu vereinfachen. Jede durch ein Leerzeichen getrennte Zeile wird als separater Teil für die Übersetzung betrachtet. Daran denken, dass beim Erstellen von Texten, dass große monolithische Textfragmente für Übersetzer schwer zu übersetzen sind.
Die Ergebnisse könnten wie folgt aussehen:
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")
Diskussion im FreeCAD-Forum: https://forum.freecad.org/viewtopic.php?f=21&t=61998