Cancel
Showing results for 
Search instead for 
Did you mean: 

How to get TxKinematicLink for TxComponent

Pioneer
Pioneer

Trying to get the TxKinematicLink for TxComponent but it is returning null, while it is working for txDevice object?

 

Needed help quickly and appricate you all for your replies and knowledge

 

Regards,

Sandeep

5 REPLIES 5

Re: How to get TxKinematicLink for TxComponent

Siemens Phenom Siemens Phenom
Siemens Phenom
Sounds like correct behavior.
A component without kinematic links is no device.

Re: How to get TxKinematicLink for TxComponent

Legend
Legend

You have to cast your TxComponent in a TxDevice.

Look in the following examples:

Example 1

Example 2

Re: How to get TxKinematicLink for TxComponent

Legend
Legend

Sandeep,

 

TxComponent has a property Links, which returns you a TxObjectList with all definied links in the component. If Component has no defined links, it will return empty list or null.

A device is a component with a kinematic. So, device has per definition a links and jointa and component can have links and joints.

You can add kinematic to the component, by definng at least two links and one joint.

Witalij.

Re: How to get TxKinematicLink for TxComponent

Pioneer
Pioneer
Thanks Witalji,

As you mention, I tried to cast TxComponent.Joint[0].Device but no luck for me because in my solution all the components don't have any joint and link. Does it possible ? or any other way to do that.

Basically I am looking for geometry info of each component and what I am seeing it can get through devices TxKinematicLink ( it has Approximation.Points, Approximation.joints, Approximation.Normals)

Could you please help/suggest a way to get this above info for component ?

Regards,
Sandeep

Re: How to get TxKinematicLink for TxComponent

Legend
Legend

Sandeep,

 

yes, it is possible, that components doesn't have a kinematic links.

In order to get all geometries in a component use GetAllDescendants function with filter on ITxGeometry:

TxObjectList geometries = component.GetAllDescendants(New TxTypeFilter(GetType(ITxGeometry)))