Skip to main content
1-Visitor
January 8, 2018
Question

PTC_CONSTRAINT_SET Doesn't quite work properly using relations.

  • January 8, 2018
  • 2 replies
  • 9768 views

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....

2 replies

16-Pearl
January 8, 2018

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.)

MikeJ851-VisitorAuthor
1-Visitor
January 9, 2018

@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.  

19-Tanzanite
January 9, 2018

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...

MikeJ851-VisitorAuthor
1-Visitor
January 9, 2018

@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.

19-Tanzanite
January 9, 2018

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