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

Community email notifications are disrupted. While we are working to resolve, please check on your favorite boards regularly to keep up with your conversations and new topics.

Set Revision API is failing to set same Revision for Manufacturing View Part and Design part.

Yognalawade
17-Peridot

Set Revision API is failing to set same Revision for Manufacturing View Part and Design part.

Hello Experts,

 

Set Revision API is failing to set the Manufacturing View Part as the same Revision as the Design part.

 

Use Case:

The Design part has A and B versions. On Design Part B Created a New Manufacturing Part then the Manufacturing Part created with Versions A. So we have to set the Manufacturing View Part Revision B to match with Design Part.

 

Below is the API :

VersionControlHelper.service.changeRevision (); 

 

Failing with error: Version already exists, cannot create a duplicate: Part.  seems I'm attempting to change the revision ID to a value that already exists or is currently in use. Unfortunately, we cannot modify the revision ID to a value that is already being utilized. 

 

How can I identify or  what would the best steps to identified the actual issue behind this? 

 

Regards,

Yogesh 

 

1 ACCEPTED SOLUTION

Accepted Solutions


@Yognalawade wrote:

Hello Experts,

 

Set Revision API is failing to set the Manufacturing View Part as the same Revision as the Design part.

 

Use Case:

The Design part has A and B versions. On Design Part B Created a New Manufacturing Part then the Manufacturing Part created with Versions A. So we have to set the Manufacturing View Part Revision B to match with Design Part.

 

Below is the API :

VersionControlHelper.service.changeRevision (); 

 

Failing with error: Version already exists, cannot create a duplicate: Part.  seems I'm attempting to change the revision ID to a value that already exists or is currently in use. Unfortunately, we cannot modify the revision ID to a value that is already being utilized. 

 

According to article https://www.ptc.com/en/support/article/CS162604 that Tony referenced this is one of those:

"Works to product specification:

 

How can I identify or  what would the best steps to identified the actual issue behind this? 

 


Seeing as how you are an actual PTC employee then you need to get R&D to actually fix the issue instead of bailing out with a "Works to Product Specification".

 

I have been successfully using VersionControlHelper.service.changeRevision() for years to correct revision labels. We have only used Design view. However are starting to look at using other views. Unlike Tony I just recently converted so down stream views have the same versioning scheme as the Design View. After that I have created a few new view versions and then tried using the VersionControlHelper.service.changeRevision() to set the revision of the Manufacturing view to be same as the Design View and had the same issue you are having:

"Version already exists, cannot create a duplicate: Part"

 

I have fixed this issue on my end by copying the relevant parts of VersionControlHelper.service.changeRevision() into my existing custom change revision class and modifying it to account for views. It is a simple change to the  getControlBranchesOf() method to add SearchConditions to limit the controlbranches to the same viewId.

View solution in original post

7 REPLIES 7
avillanueva
22-Sapphire II
(To:Yognalawade)

I am still running the old method where Design view is A and Mfg view would become A.- (double revision letter), B would become B.-. Someday I will convert...but saw this problem as a headache that you are seeing.

Are you sending the changeRevision method the Mfg View part?

Take a look at this:

https://www.ptc.com/en/support/article/CS162604?source=search

I am using this method all the time but not for Mfg views. Never tried if for that. Perhaps they are blocking its use.

 

 

Hi @Yognalawade 

@avillanueva has found good hint. The article mentions "The API should not be used on a regular basis".

Perhaps the method is written to use only for new objects, not for the regular changing.

So in your case there is some control mechanism in the method that do not allow you to change the revision if the object already has one. 

Does not matter if it is possible now that Design and Mfg view can use same revision now. The method is not written for it as you would expect.   

 

You need to find an another way how to change the revision. 

 

Please provide full error and also Windchill version. If you open the generic method you would find a function that change the revision without control or you could write own based on the existing one. 

 

PetrH


@Yognalawade wrote:

Hello Experts,

 

Set Revision API is failing to set the Manufacturing View Part as the same Revision as the Design part.

 

Use Case:

The Design part has A and B versions. On Design Part B Created a New Manufacturing Part then the Manufacturing Part created with Versions A. So we have to set the Manufacturing View Part Revision B to match with Design Part.

 

Below is the API :

VersionControlHelper.service.changeRevision (); 

 

Failing with error: Version already exists, cannot create a duplicate: Part.  seems I'm attempting to change the revision ID to a value that already exists or is currently in use. Unfortunately, we cannot modify the revision ID to a value that is already being utilized. 

 

According to article https://www.ptc.com/en/support/article/CS162604 that Tony referenced this is one of those:

"Works to product specification:

 

How can I identify or  what would the best steps to identified the actual issue behind this? 

 


Seeing as how you are an actual PTC employee then you need to get R&D to actually fix the issue instead of bailing out with a "Works to Product Specification".

 

I have been successfully using VersionControlHelper.service.changeRevision() for years to correct revision labels. We have only used Design view. However are starting to look at using other views. Unlike Tony I just recently converted so down stream views have the same versioning scheme as the Design View. After that I have created a few new view versions and then tried using the VersionControlHelper.service.changeRevision() to set the revision of the Manufacturing view to be same as the Design View and had the same issue you are having:

"Version already exists, cannot create a duplicate: Part"

 

I have fixed this issue on my end by copying the relevant parts of VersionControlHelper.service.changeRevision() into my existing custom change revision class and modifying it to account for views. It is a simple change to the  getControlBranchesOf() method to add SearchConditions to limit the controlbranches to the same viewId.

Hi @RandyJones 

I would do same if I needed it, 

PetrH

Hello Randy Jones,

Thank you for your explanation. This helps me to understand the issue. I will try accordingly.

 

Regards,

Yogesh   

olivierlp
Community Manager
(To:Yognalawade)

Hi @Yognalawade 
I wanted to see if you got the help you needed.
If so, please mark the appropriate reply as the Accepted Solution. It will help other members who may have the same question.
Please note that industry experts also review the replies and may eventually accept one of them as solution on your behalf.
Of course, if you have more to share on your issue, please pursue the conversation. 

Thanks,

Olivier

Hello Olivier,

 

Yes. I got the hint now. 

Thanks you. 

 

Regards,

Yogesh 

Top Tags