Macro Wiki Object Properties List Generator

Description
Macro for generate optimized properties list of selected object. List presented in wiki format into python report view window. If it possible, properties that are inherited from the parent object are removed.

Link to previous version

Indroduction
Diagramm...

How To Use
...

Recomendations
...

Examples of using
...

Example of ...
...

Script
"+re.sub(r"[\[\]\']","",str(atr))    else:         atr = ""      if blacklist == None or (blacklist != None and pr not in blacklist):         prop[str(i)] = pr,obj.getGroupOfProperty(pr),tp.replace("App::Property",""),obj.getDocumentationOfProperty(pr),atr         i+=1      else:         inherits += pr + " inherited from class" + blacklist[pr] + "\n"

if inherits != "": print("\n < !--\n"+inherits+"-- > ") 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"+"") print("\n"+"* : "+pr[1][3])

def add_to_blacklist(data_blacklist,view_blacklist,obj_type,temp_obj_name): print("Class: '"+obj_type+"'") # Make tempory object obj = FreeCAD.activeDocument.addObject(obj_type,temp_obj_name) name = obj.Name # Get Data parametrs print("Data parameters list:") for pr in obj.PropertiesList: if pr not in data_blacklist: data_blacklist[pr]=obj_type atr = str(obj.getTypeOfProperty(pr)).replace("[]","") print(pr+atr) # Get View parameters if it is possible obj = Gui.activeDocument.getObject(name) try: test = obj.PropertiesList print("View parameters list:") for pr in obj.PropertiesList: if pr not in view_blacklist: view_blacklist[pr]=obj_type atr = str(obj.getTypeOfProperty(pr)).replace("[]","") print(pr+atr) except: print("This class not support View parameters.") # Remove object FreeCAD.activeDocument.removeObject(name) print return data_blacklist,view_blacklist
 * 1) Add propertyes to blacklist if it not presentet in it yet

def fill_blacklists: data_blacklist={} view_blacklist={} # Interfaces are not supported #data_blacklist,view_blacklist = add_to_blacklist(data_blacklist,view_blacklist,"App::OriginGroupExtension","Temp") #data_blacklist,view_blacklist = add_to_blacklist(data_blacklist,view_blacklist,"Part::AttachExtension","Temp") #data_blacklist,view_blacklist = add_to_blacklist(data_blacklist,view_blacklist,"Sketcher::PropertyConstrainList","Temp") data_blacklist,view_blacklist = add_to_blacklist(data_blacklist,view_blacklist,"App::DocumentObject","Temp") data_blacklist,view_blacklist = add_to_blacklist(data_blacklist,view_blacklist,"App::GeoFeature","Temp") data_blacklist,view_blacklist = add_to_blacklist(data_blacklist,view_blacklist,"App::Part","Temp") data_blacklist,view_blacklist = add_to_blacklist(data_blacklist,view_blacklist,"Mesh::Feature","Temp") data_blacklist,view_blacklist = add_to_blacklist(data_blacklist,view_blacklist,"Fem::FemMeshObject","Temp") data_blacklist,view_blacklist = add_to_blacklist(data_blacklist,view_blacklist,"Path::Feature","Temp") data_blacklist,view_blacklist = add_to_blacklist(data_blacklist,view_blacklist,"Part::Part2DObject","Temp") # Part::Primitive is not possible to create #data_blacklist,view_blacklist = add_to_blacklist(data_blacklist,view_blacklist,"Part::Primitive","Temp") data_blacklist,view_blacklist = add_to_blacklist(data_blacklist,view_blacklist,"PartDesign::Feature","Temp") data_blacklist,view_blacklist = add_to_blacklist(data_blacklist,view_blacklist,"Part::BodyBase","Temp") data_blacklist,view_blacklist = add_to_blacklist(data_blacklist,view_blacklist,"PartDesign::Body","Temp") print(data_blacklist) print print(view_blacklist) print return data_blacklist,view_blacklist

sel = FreeCADGui.Selection.getSelection if len(sel) != 1: print ("You mast select one object!") else: msgbox = QtGui.QMessageBox(QtGui.QMessageBox.Question, u'Properties Generator', """Select type of report""") main_info = msgbox.addButton("All Main classes", QtGui.QMessageBox.AcceptRole) full_report = msgbox.addButton("Full Report", QtGui.QMessageBox.AcceptRole) without_inherits = msgbox.addButton("Without inherits", QtGui.QMessageBox.RejectRole) msgbox.exec_ res = msgbox.clickedButton if res == main_info : data_blacklist,view_blacklist=fill_blacklists if res == without_inherits or res == full_report: name = sel[0].Name act_obj = Gui.activeDocument.getObject(name) data_blacklist={} view_blacklist={} if res == without_inherits: data_blacklist,view_blacklist=fill_blacklists print("\n"+"==Properties==") print("\n"+"===View===") print_obj_properties(act_obj,"View",view_blacklist) print("\n"+"===Data===") act_obj = FreeCAD.activeDocument.getObject(name) print_obj_properties(act_obj,"Data",data_blacklist)

Links
The discussion on the forum []