I am interfacing CATIA with Python in order to obtain the inertia matrix of some body. When arriving to the inertia matrix object, which is labeled as:
bound method GetInertiaMatrix of COMObject Item
I am unable to obtain any components of the matrix. I have been reading throughout whole internet and there is some people with the same problem than me, but it seems unsolved still. The code to obtain the inertia matrix object is listed below, in which obj_part
refers to the part object, obj_doc
refers to the part object document, and so on.
obj_ref = obj_part.CreateReferenceFromObject(body_to_measure);
obj_SPA = obj_doc.GetWorkBench("SPAWorkbench");
obj_measurable = obj_SPA.GetMeasurable(obj_ref);
obj_inertias = obj_SPA.Inertias;
obj_inertias.Add(body_to_measure);
obj_inertia = obj_inertias.Item(1);
inertia_matrix = obj_inertia.GetInertiaMatrix;