find all references to a component in a model
Posted: Thu Jun 25, 2020 8:58 am
Hi,
I am removing a CustomJoint from my model and replacing it with a new PinJoint, using model.updJointSet().remove(joint);
When I remove the CustomJoint, the coordinates are accordingly removed, but this causes problems if other components depend on the removed coordinates. In this example, I have a SpringGeneralizedForce who's <coordinate>knee_add_r</coordinate> property is the name of one of the deleted coordinates.
I know I can use model.findComponent to access the location of a specific component. Is there a method to find all references to a component such that I could detect the problem above?
I think this specific example is slightly out dated as the <coordinate> property should probably be a socket if SpringGeneralizedForce were refactored. Is there a way to find all sockets that reference a specific component?
I am removing a CustomJoint from my model and replacing it with a new PinJoint, using model.updJointSet().remove(joint);
When I remove the CustomJoint, the coordinates are accordingly removed, but this causes problems if other components depend on the removed coordinates. In this example, I have a SpringGeneralizedForce who's <coordinate>knee_add_r</coordinate> property is the name of one of the deleted coordinates.
I know I can use model.findComponent to access the location of a specific component. Is there a method to find all references to a component such that I could detect the problem above?
I think this specific example is slightly out dated as the <coordinate> property should probably be a socket if SpringGeneralizedForce were refactored. Is there a way to find all sockets that reference a specific component?