PTC_CONSTRAINT_SET and distance calculation
- December 5, 2019
- 17 replies
- 7984 views
Hi,
I have made a simple test assembly to show how components with PTC_CONSTRAINT_SET don't always behave the way I want/expect them to. I want to be able to add/remove/configure components quickly and have used a combination of PTC_CONSTRAINT_SET and distance calculations to achieve this. This assembly consists of four parts - cube, sphere, pyramid and cylinder placed on a fifth part called ground. The four parts can be added or removed based on the value of connected parameters called cube, sphere, pyramid and cylinder. The pyramid and cylinder parts can also change orientation by changing the value of parameters PYRAMID_ORIENTATION and CYLINDER_ORIENTATION. Can someone please have a look at the attached assembly PTC_CONSTRAINT_SET.asm and tell me why the parts behave the way they do?
Initially, the assembly looks like this:
Here is the complete relations text in PTC_CONSTRAINT_SET.asm
Here are the available values for configuration parameters. I have also added planes with the same names in a group called configuration for easy configuration - you can change the parameter values easily by changing the values of these planes.
(The values are initially set to CUBE=1, SPHERE=1, PYRAMID=1, PYRAMID_ORIENTATION=0, cylinder=1 and CYLINDER_ORIENTATION=0).
If I remove the cube part (change value of cube to 0) and click regenerate, the assembly looks like this:
If I change the orientation of the pyramid part (change value of pyramid_orientation to 1), it looks like this:
Finally, changing cylinder_orientation to 1 makes it look like this:
The cylinder part is misplaced and regenerate doesn't do anything, but if I either click edit definition or resume/suppress, the assembly looks like this:
At first, I made the assembly without the cylinder part, but the model would only get stuck occasionally and I could not seem to reproduce it consistently, so I added another part with PTC_CONSTRAINT_SETs and now it gets stuck very often. It will get stuck in certain combinations and regenerate doesn't do anything, can someone please tell me why? How does regenerate and edit definition consider placement differently? This is obviously not a huge problem with this simple assembly, but I am trying to use the same method for more complex assemblies and that causes more problems. As I already wrote, the more components with PTC_CONSTRAINT_SETs, the messier it gets. Any suggestions?
Thanks,
Avero
Edit: I am using Creo 5
Screenshot of Model intent -> Program

