Kunda1 wrote: ↑Fri Feb 28, 2020 6:20 pm
Cool. Would you help me identify the strings I would need to
grep ?
What strings?
The command name is the most important one; you already found all command names above.
The second thing that could be checked, but this is much more complicated, is identifying the properties in the code. All objects in the source have properties, which must be documented. If a property changes, the object will break of fail to work correctly. So, identifying all properties of the object is going to be difficult because the properties could be defined in different ways.
In Python, the properties are added usually inside the class of the object.
https://github.com/FreeCAD/FreeCAD/blob ... py#L15-L25
Code: Select all
class IfcRoot:
def setProperties(self, obj):
if not "IfcData" in obj.PropertiesList:
obj.addProperty("App::PropertyMap","IfcData","IFC",QT_TRANSLATE_NOOP("App::Property","IFC data"))
if not "IfcType" in obj.PropertiesList:
obj.addProperty("App::PropertyEnumeration","IfcType","IFC",QT_TRANSLATE_NOOP("App::Property","The type of this object"))
obj.IfcType = self.getCanonicalisedIfcTypes()
if not "IfcProperties" in obj.PropertiesList:
obj.addProperty("App::PropertyMap","IfcProperties","IFC",QT_TRANSLATE_NOOP("App::Property","IFC properties of this object"))
Every property is added with
Code: Select all
obj.addProperty("App::PropertyMap","IfcProperties", ..., ...)
The first argument is the type, and the second argument is the "Name" of that property, which will be displayed in the
property editor.
But this property is tied to the class where it appears. So, in this case, you need to get the class "IfcRoot", and its properties "IfcData", "IfcType", "IfcProperties", etc. Just getting all properties in a file is not good enough. You need to know which properties correspond to which class.
In C++ it's a bit more complicated, because each property is instantiated as an object of the property type (a class itself).
https://github.com/FreeCAD/FreeCAD/blob ... .h#L32-L58
Code: Select all
namespace Part
{
class PartExport BodyBase : public Part::Feature, public App::OriginGroupExtension
{
PROPERTY_HEADER_WITH_EXTENSIONS(Part::BodyBase);
public:
BodyBase();
App::PropertyLink Tip;
App::PropertyLink BaseFeature;
This tells you that the new object is a "BodyBase" object. It has two properties, "Tip" and "BaseFeature", both of type "App::PropertyLink". But there are many types of properties, so any object could potentially have any one of them. See
property.