Cancel
Showing results for 
Search instead for 
Did you mean: 

How to execute collision between gun and part via .Net API

Valued Contributor
Valued Contributor

Is there a way to execute collision between gun and part via .Net API? 

Thanks in advance for any reply.

 

Regards,

KX

2 REPLIES

Re: How to execute collision between gun and part via .Net API

Siemens Creator Siemens Creator
Siemens Creator

Hi KX,

 

Below is an example on how to create collision between two ITxObjects and the execution

 

TxCollisionRoot root = TxApplication.ActiveDocument.CollisionRoot;

TxObjectList list1 = new TxObjectList();

list1.Add(a);

TxObjectList list2 = new TxObjectList();

list2.Add(b);

TxCollisionPairCreationData cd = new TxCollisionPairCreationData("cp1", list1, list2, 3.0);

TxCollisionPair cp = root.CreateCollisionPair(cd);

TxCollisionQueryParams queryParams = new TxCollisionQueryParams();

queryParams.Mode = TxCollisionQueryParams.TxCollisionQueryMode.DefinedPairs;

queryParams.NearMissDistance = 5.0;

TxCollisionQueryResults results = root.GetCollidingObjects(queryParams);

 

I hope you find it useful.

 

Regards,

Adi

Re: How to execute collision between gun and part via .Net API

Valued Contributor
Valued Contributor

Hi @AdiAvron 

 

Thanks a lot, it helped me.

 

Regards,

KX