cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

PTC_CONSTRAINT_SET Doesn't quite work properly using relations.

Regular Member

PTC_CONSTRAINT_SET Doesn't quite work properly using relations.

Through the power of search, I found this parameter (PTC_CONSTRAINT_SET) to help me insert a single part into an assembly, and place it in different locations using different constraint sets.  During my search, I found this and used it in my assembly relations.

 

if POSITION == 2
  PTC_CONSTRAINT_SET:FID_40 = "Set_no_2"
endif
if POSITION == 1
  PTC_CONSTRAINT_SET:FID_40 = "Set_no_1"
endif

 

It works exactly how I need EXCEPT, the sub-assembly is dynamic, meaning when condition 2 exists, the rest of the sub-assembly changes sizes.  When condition 1 exists, the part is located on the side, when condition 2 exists, it is located on the front.  It positions the parte parallel to all of its constraints upon regenerate, but it does not "snap" to the surface It needs to. Although the sub-assembly is changing dimensionally, the parts are the same, and the constraining surfaces are the same, so no constraints are being broken, they just aren't "snapping" to the surfaces they should.

 

When I hit edit definition, it immediately constrains exactly how it should without me hitting any other buttons.  If I revert back to condition 1, it positions it correctly as if the actual sub-assembly did not change dimensionally from the last size (but since it did change sizes, the part is not located in the correct spot) .  Not until I hit "Edit Definition" does it snap to the correct surfaces. 

 

It knows what it needs to do but it won't do it until I hit "Edit Definition".  I have noticed this happen before randomly while using Creo, but we have not been using the PTC_CONSTRAINT_SET until now.  We normally insert the component multiple times and use programming to turn FID on or off.  This is cumbersome, but as with many options in CREO, they don't seem to ever work 100 percent properly, so we usually have to find an old outdated clunky way to make things happen.  No matter how many regens I do, the part will not snap back into place until "Edit Definition" is clicked.  Frustrated....

13 REPLIES 13

Re: PTC_CONSTRAINT_SET Doesn't quite work properly using relations.

What version of Creo are you using? I filed a ticket on Creo 2.0 probably 3-4 years and I believe it resulted in an SPR. I do not recall if the issue was ever resolved. (I haven't used the functionality since.)

Dave Martin - dmartin@creowindchill.com - https://www.creowindchill.com

Re: PTC_CONSTRAINT_SET Doesn't quite work properly using relations.

I tried a test assembly with Creo 2.0 (M240) - I got the same behaviour as you describe - namely, the programmed component would get "unstuck" only if the edit definition function was used on it.  Then I saved this assembly (with the component floating in space because it hasn't snapped to the updated surface), erased all displayed, and then re-opened the assembly.  The component was in the correct place and the odd behaviour stopped - give it a try...

Re: PTC_CONSTRAINT_SET Doesn't quite work properly using relations.


@DaveMartin wrote:

What version of Creo are you using? I filed a ticket on Creo 2.0 probably 3-4 years and I believe it resulted in an SPR. I do not recall if the issue was ever resolved. (I haven't used the functionality since.)


Using 3.0. It would be great for this functionality to exist, as it seems it would cut our file sizes down quite a bit.  

Re: PTC_CONSTRAINT_SET Doesn't quite work properly using relations.


@pausob wrote:

I tried a test assembly with Creo 2.0 (M240) - I got the same behaviour as you describe - namely, the programmed component would get "unstuck" only if the edit definition function was used on it.  Then I saved this assembly (with the component floating in space because it hasn't snapped to the updated surface), erased all displayed, and then re-opened the assembly.  The component was in the correct place and the odd behaviour stopped - give it a try...


I am using 3.0.  Thank you for taking the time to replicate this issue.  Makes me feel better to know that this is not isolated. As to the possible solution you have come up with, the problem is that we often work in a single session.  after all of our initial work is done to build our models with the configurability through the layouts, we work off a single session to complete a custom job and then we go on to the next job.  it would be prohibitive to accept this as the only solution.  Thank you again for testing this out.

Re: PTC_CONSTRAINT_SET Doesn't quite work properly using relations.

Well, I did something and the example assembly I concocted last night wouldn't work again this morning.  Same bogus sticking behaviour fixed only by "edit definition".  This all seems to do with how Creo "flags" what needs regenerating.

 

Anyway, I dug a little more into it and was able to get better results if I put in the relations at the component level.

 

In your example, you had assembly level relations:

if POSITION == 2
  PTC_CONSTRAINT_SET:FID_40 = "Set_no_2"
endif 
if POSITION == 1
  PTC_CONSTRAINT_SET:FID_40 = "Set_no_1"
endif

Try changing those to be evaluated at the component level (in your case, you would execute tools->relations->look in "component"->pick the component FID_40->enter in these directly:

 

if POSITION == 2
  PTC_CONSTRAINT_SET = "Set_no_2"
endif 
if POSITION == 1
  PTC_CONSTRAINT_SET = "Set_no_1"
endif

 

Re: PTC_CONSTRAINT_SET Doesn't quite work properly using relations.


@pausob wrote:

Well, I did something and the example assembly I concocted last night wouldn't work again this morning.  Same bogus sticking behaviour fixed only by "edit definition".  This all seems to do with how Creo "flags" what needs regenerating.

 

Anyway, I dug a little more into it and was able to get better results if I put in the relations at the component level.

 

In your example, you had assembly level relations:

if POSITION == 2
  PTC_CONSTRAINT_SET:FID_40 = "Set_no_2"
endif 
if POSITION == 1
  PTC_CONSTRAINT_SET:FID_40 = "Set_no_1"
endif

Try changing those to be evaluated at the component level (in your case, you would execute tools->relations->look in "component"->pick the component FID_40->enter in these directly:

 

if POSITION == 2
  PTC_CONSTRAINT_SET = "Set_no_2"
endif 
if POSITION == 1
  PTC_CONSTRAINT_SET = "Set_no_1"
endif

 


Thank you for your continued support on this.  I don't believe this will work for us though, because we use that component in many different assemblies.  Or do I have this incorrect?  In the example you propose, are the relations actually being saved into the part or into the assembly, but at a different level?   I should try this out and at least learn something.  Thank you again.

Re: PTC_CONSTRAINT_SET Doesn't quite work properly using relations.

A component is the unique occurrence of an object in an assembly.  The component is part of the assembly and any relations placed inside a component are stored in that assembly.  Think of a component as a unique object + assembly relations + assembly placement constraints.  If the same model is assembled 4 times there is only one model but there are 4 unique components.

Re: PTC_CONSTRAINT_SET Doesn't quite work properly using relations.

I had no luck putting relations at the component level. Manually clicking "edit definition" on every component that is misplaced is still the only solution. It is quite annoying trying to make smarter 3d models with skeleton/relations/program when errors like this show up. One would think this would be highly prioritized for a program called Creo Parametric? Why doesn't Creo seem to flag all components with placement relations for regeneration? Anyone found a solution to this problem?

Re: PTC_CONSTRAINT_SET Doesn't quite work properly using relations.

Well, it seems to work for me.  I attach a toy model for demonstration:

multi_position_demo.png

 

Changing the value of the assembly parameter "POSITION" changes the configuration of this assembly.

This includes change of shape of the stationary part (1st block), the displayed labels and notes, and the constraint types of the 2nd block (the one labelled with the prime').

 

The logic is coded in relations at various levels (assembly, component and feature).  Another important bit is use of associated parameters as this assembly involves flexible components.

 

There is still something wonky going on in that switching from configuration "1" to configuration "3" requires a double-regeneration (the 1st regeneration leads to a green-light, but the component is clearly not in the right place) I think that is a bug related to the slider connection having motion limits.

 

Modifying or debugging such a model can be a nightmare.

For example, when I was adding the 3rd configuration, I found I had to temporarily delete all the component relations in the 2nd block.  Otherwise the system didn't really let me add the slider constraint set as it was failing in "finding" a connection - I think it was because the relations were in play and during the definition of the new constraint, they would try to make one of the previously defined constraint sets active (even though I disabled them all during the definition).  I suppose I should have set the value of "POSITION" to 3 during this phase.

As expected, there were no helpful messages as to what was going wrong.

 

In summary, I'm not surprised that relations involving PTC_CONSTRAINT_SET can lead to frustration, because  a lot of things can go wrong while building such a model.  But if the relation logic is sound, the software does work - for the most part.

 

(attached models are made using Creo 2.0 - I'd be interested to hear if the "slider bug" is solved in newer versions)