01-03-2017 11:37 AM
I import a cojt in Process Simulate Standalone in order to create a kinematics for a component. The invocation of TxApplication.ActiveDocument.PhysicalRoot.InsertComponent gets me an instance of TxComponent.
The Class TxComponent implements the Interface ITxKinematicsModellable, that allows creation of the kinematic links and joints (TxKinematicLink and TxJoint). But I miss a possibility to create a pose (class TxPose) for a TxComponent.
I have found possibility to create a pose just for a device (Interface ITxDevice), but I cannot find any possibility to convert a TxComponent instance to ITxDevice.
It is possible to create a pose for imported component over the user interface, but .NET API does not expose this possibility.
Have I overseeing anypossibility?
Solved! Go to Solution.
01-03-2017 01:38 PM
Hi,
it is not possible to create a Pose in a TxComponent.
You have to convert your component to a TxDevice.
That can be done after the joint creation.
TxComponent component = new TxComponent(); ... ITxDevice device = component.Joints[0].Device as ITxDevice;
01-04-2017 02:13 AM
Thank you!
I will test this.
01-04-2017 08:36 AM
It does the job for me.
It is not clearly evident way to get a device from a component over the a joint. May be the evident ppossibility can be exposed in the next version of .NET Api.
11-06-2018 04:36 PM
Works for me. I created 2 helper functions for the future:
public static bool CanConvertComponentToDevice(TxComponent comp) { if (comp.Joints.Count > 0) { return true; } else { return false; } } public static ITxDevice GetDeviceFromComponent(TxComponent comp) { return comp.Joints[0].Device; }
Watch Replays of Previous Topics