brengine
Mechanical
- Apr 19, 2001
- 616
Continuation of thread559-202450...
Handleman,
I finally had a (for lack of a better word) opportunity to delve into the InsertDistanceMate macro you wrote. One thing I've come across is that with AddMate3...even tho you specify AlignmentCLOSEST, the command does not obey that. I saw all of the additional code you used to try and get the part back to it's original position, but it still didn't prove to be 100% bulletproof for me (in predicting the initial position, everything else worked great). The Alignment and Flip seem to have a mind of their own, and it was very difficult to predict what they would do when creating test mates over-and-over and watching the behavior.
So I was tinkering with the code, and discovered this:
[ul]
[li]AddMate2 is just as unreliable/unpredictable (requiring the major trial and error, as you had went thru)[/li]
[li]AddMate on the other hand does not move the part around at all. It actually does apply the Aligned/Anti-Aligned that is the CLOSEST. And you already had the legwork done to find the inital distance and Flip orientation, so using this code rather than AddMate3 has so far been working really well for me.
[/li]
[/ul]
Obviously, the major drawback with this command is that it is obsolete. But for now it still seems to work well. Below is the topic from the API Help.
Enjoy,
Ken
Handleman,
I finally had a (for lack of a better word) opportunity to delve into the InsertDistanceMate macro you wrote. One thing I've come across is that with AddMate3...even tho you specify AlignmentCLOSEST, the command does not obey that. I saw all of the additional code you used to try and get the part back to it's original position, but it still didn't prove to be 100% bulletproof for me (in predicting the initial position, everything else worked great). The Alignment and Flip seem to have a mind of their own, and it was very difficult to predict what they would do when creating test mates over-and-over and watching the behavior.
So I was tinkering with the code, and discovered this:
[ul]
[li]AddMate2 is just as unreliable/unpredictable (requiring the major trial and error, as you had went thru)[/li]
[li]AddMate on the other hand does not move the part around at all. It actually does apply the Aligned/Anti-Aligned that is the CLOSEST. And you already had the legwork done to find the inital distance and Flip orientation, so using this code rather than AddMate3 has so far been working really well for me.
[/li]
[/ul]
Code:
swAssy.AddMate swMateDISTANCE, swMateAlignCLOSEST, False, CurDist, 0
Enjoy,
Ken