AnsweredAssumed Answered

Collision Detection with SolidWorks API

Question asked by Nikolay Bratovanov on Nov 10, 2016
Latest reply on Jul 17, 2019 by Joshua Steigerwald

Hello,

 

I have created a macro which moves a robot assembly by reading the joint coordinates from an external txt file. I'm using the IDragOperator Interface and everything works just fine. What I am trying to do now is to enable the Collision Detection function - for example - if the robot arm hits a specific component (some sort of obstacle, equipment, etc.), the motion to be interrupted (stop at collision) or an alarm to be triggered (highlight the component or produce a sound). The problem is that when I set the swDragOp.CollisionDetectionEnabled = True and specify the Collision Detection Settings [swDragOp.CollisionDetection (EntityArray, PartOnly, StopAt)], either the motion of the assembly is not executed at all or the whole assembly is torn apart (or disappeared). Is anyone familiar with the Collision Detection implementation with SolidWorks API? I would be grateful for some help. Thank you!

Outcomes