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

PTC_CONSTRAINT_SET and distance calculation

SOLVED
Highlighted

Re: PTC_CONSTRAINT_SET and distance calculation


@jbob wrote:

question, when using multiple constraint sets and you rotate that component, don't you get invalid constraints during the edit definition? 


No, because the first constraint set is completely disabled when the second set is enabled.  The two sets don't fight with each other since only one set is active at a time.

Highlighted

Re: PTC_CONSTRAINT_SET and distance calculation

Hi, this remains an interesting unsolved case.

I can't open your Creo5 file so tried to make toy example similar to your new example - using similar structure of assembly level relations & pro/program code to drive constraint sets and existence of components.

 

Except I didn't use a value of a dimension to determine the logic of whether a component exists or is rotated - I defined Yes/No assembly level parameters:

ptc_constraint_set_demo-1.png

 

Toggling these yes/no parameters and regenerating seems to work just fine.  Please try the attached model yourself.

 

So your code should work, I think, but there is something wrong:

- something in your assembly constraints that gives problems?  unlikely as re-edit-definition fixes the connections without picking new references

 

- using dimensions (real numbers) to define On/Off states - round-off errors causing the logic to fail?  - again, unlikely because it seems that the correct offset values and constraint set names are being set.

 

- bug ? - nah, this is PTC software 🙂 

 

Highlighted

Re: PTC_CONSTRAINT_SET and distance calculation

Forcing a model player regen also fixes the issues with the original model.  That's why I wondered if it was a regeneration order issue.  Unfortunately I wasn't to find anything like that, even after reordering a bunch of stuff.

Highlighted

Re: PTC_CONSTRAINT_SET and distance calculation

Yes/No parameters seem to work fine, but sometimes I want to have more than two options for each parameter, for example a parameter called placement could have the options left, right, front, back, roof, internal etc. I don't think I could make that work with only yes/no. Perhaps I should give string parameters a try? I would still be interested to know if this is some kind of bug or if I'm doing something wrong somehow. 

Re: PTC_CONSTRAINT_SET and distance calculation

As you suggest, string type parameters should work great for those multiple-choice scenarios.

You could also use parameter of integer type (though the coding would have to be documented - which is a good thing).

In general, I think that parameters are more appropriate for storing and manipulating the "meta" information about the model, while dimensions should just describe feature locations and sizes.

So, frankly, I think that your implementation of using the dimension values to encode "state information" is an inventive hack which will be hard to maintain and to explain to new users.  Nevertheless, I don't see why it would cause the demonstrated weird behaviour - therefore I am curious about PTC response.

Highlighted

Re: PTC_CONSTRAINT_SET and distance calculation

Where does L1_DIST and L2_DIST come from in your model? I can't seem to find parameters with those names on any level?

 

The main difference between my model and yours seem to be that you have attached the components to a number of level planes (I don't think I could use this method as I might want to place the components on any side of the component named ground) rather than it being constrained to a distance from the assembly coordinate system origin, which made me wonder - If I want Creo to do more than one distance calculation (one for each constraint set) the correct way to do this is

 

IF CUBE==1&SPHERE==1&PYRAMID==0

D31=500

D26=500

 

Right? I have also tried

 

IF CUBE==1&SPHERE==1&PYRAMID==0

D31=500&D26=500

 

But that gives an error.

 

I have now also tried using integer, yes/no and string parameters instead of real number, but the same behavior as before occurs in my model.

 

PARAMETER is real number, as used on the first page of this thread. PARAMETER_1 is integer type, PARAMETER_2 is yes/no and PARAMETER_3 is string type parameter. It doesn't seem to matter (to Creo) which one I use.

 

 1_1.PNG1_2.PNG2_1.PNG2_2.PNG3_1.PNG3_2.PNG

Highlighted

Re: PTC_CONSTRAINT_SET and distance calculation

 


@avero wrote:

Where does L1_DIST and L2_DIST come from in your model? I can't seem to find parameters with those names on any level?

 

L1_DIST and L2_DIST are just named dimensions - they control the distances between the level planes.

 

The main difference between my model and yours seem to be that you have attached the components to a number of level planes (I don't think I could use this method as I might want to place the components on any side of the component named ground) rather than it being constrained to a distance from the assembly coordinate system origin, which made me wonder - If I want Creo to do more than one distance calculation (one for each constraint set) the correct way to do this is

 

IF CUBE==1&SPHERE==1&PYRAMID==0

D31=500

D26=500

 

That should work... (see below)

 

Right? I have also tried

 

IF CUBE==1&SPHERE==1&PYRAMID==0

D31=500&D26=500

 

The above syntax is not correct.

 

 

But that gives an error.

 

I have now also tried using integer, yes/no and string parameters instead of real number, but the same behavior as before occurs in my model.

 

PARAMETER is real number, as used on the first page of this thread. PARAMETER_1 is integer type, PARAMETER_2 is yes/no and PARAMETER_3 is string type parameter. It doesn't seem to matter (to Creo) which one I use.

 

 1_1.PNG1_2.PNG2_1.PNG2_2.PNG3_1.PNG3_2.PNG


So just as you were saying all along, it seems that there is a bug in the software because changing value of dimensions that belong to inactive constraint set does not update the placement (the value changes, but system does not regenerate the component in the new location).

 

This is very hard to explain well, so I attach the model for your review.

ptc_constraint_set_demo-2.png

if link3's constraint set "Upright" is active because link3_rotated parameter is set to NO, then changing the above relations to offset_upright = 0 and regenerating will lower link3.

However, if instead you change the above to offset_side = 0, then set the value of parameter link3_rotated to YES, and then regenerate - this will leave the link3 in its old location (44 units above).  Then doing the "edit definition" will snap it back to the new setting of 0.

Highlighted

Re: PTC_CONSTRAINT_SET and distance calculation

I don't think you attached the model as you intended, but I understood the explanation. It seems we agree this must be a software bug then; you should be able to change values of currently inactive constraint sets and the components should then be placed correctly when the active constraint set changes upon regenerating the model. This doesn't seem to happen when you manually edit values of inactive constraint sets though, only when using relations.

Announcements
Message from Brian Thompson (PTC General Manager and DVP) regarding Creo Business Continuity plans.