Ansys Mechanical ACT, Access to the properties of a Child-Object
Hello all!
I would like to know, whether it is possible and how to query the properties of a child-object with the use of an other child-objects reference.
Wha I want, is, to get access to the properties of the CH_2 object, using the reference of the CH_1 object (for example using the passed object reference in the ongenerate callback function of the CH_1 object).
(I have made several attempts with CH_1.Parent.Childen and CH_1.Parent.InternalObject.Children, however, I get back a ComObject as a refernece without access to the properties)
Thank you for your help!
Best Answer
-
child2_tree_object = Tree.FirstActiveObject child2 = ExtAPI.DataModel.GetUserObjectById(child2_tree_object .ObjectId) parent = child2.Parent child1 = list(parent.Children)[0] for prop in child1.Properties: print prop.Value
1
Answers
-
Dear Landon,
Thank you for your quick response. I could also print the properties with the ongenerate function of my child-object. (The key was the second line of your code with the GetUserObjectByID function.)
Best regards,
av0