Skip to main content
8-Gravel
October 22, 2024
Question

Remove part structure details from the engineering part

  • October 22, 2024
  • 3 replies
  • 1707 views

Version: Windchill 12.0

 

Use Case: hi, I want to delete the part structure details for many of the parts at a time , such that it removes the structure details of the parent part completely for the current revision.


Description:

is there any utility or API  to help get the changes updated ? please assist if anything helps

3 replies

avillanueva
23-Emerald I
23-Emerald I
October 22, 2024

Are you looking at whacking the part from a BOM? That data is housed in the WTPARTUSAGELINK table I believe. normally this is done via the interface via check out and in process since this change should be done under an iteration. Are you looking at removing history? Like all instances of the linkage in the past?

ashiq_0978-GravelAuthor
8-Gravel
October 23, 2024

Correct, I want to remove the history of the Bom details like the link needs to be removed.

avillanueva
23-Emerald I
23-Emerald I
October 23, 2024

Yes, there exists an API (PersistenceHelper) but there is likely more involved they just removing this link in all of history. I am sure there are other tables that could be impacted like Occurrences, substitutes, etc. Removing via API at a low level might circumvent some data integrity checks causing missing references and errors in the database records. Not something I would want to try out in production. If possible, better approach if scope is limited is to check out, remove links, check in, then purge history of those items. Its a PITA but its clean.

18-Opal
October 24, 2024

@ashiq_097 

I don’t believe there is an OOTB utility to do this.

That said, I can write a utility to do it that, given a WTPart version, would remove all Parts in the structure of all iterations of the given WTPart version WITHOUT iterating anything.

My code runs without checkout/checkin.

Note, checkout/checkin would remove the structure from only the newly created checkin iteration.

That’s not going to get the job done for you.

You want the structure removed from ALL iteration of the given version. Therefore, checkout/checkin is NOT the way to get there.

 

David

18-Opal
October 25, 2024

I couldn't resist so I wrote a utility to remove all parts from all iterations of a WTPart's structure given the WTPart's number and revision.

Runs in a Windchill shell and is bombproof. πŸ˜Š

 

In my example I have WTPart number 0000000003 which has rev A and B.

I want to remove the structure from all iterations of Rev A only.  There are six iterations of Rev A

Iteration 6

d_graham_0-1729889210435.png

 

Iteration 5

d_graham_1-1729889307774.png

Iterations 4, 3 and 2 also have a part structure.

 

I run the utility in a Windchill shell entering the WTPart's number and revision.

d_graham_2-1729889472311.png

 

After running note that no WTParts were iterated, but their structures have been completely removed.

d_graham_3-1729889722746.png

 

Here's iteration 6 after running the utility.

d_graham_4-1729889880852.png

Here's iteration 5 after running the utility.

d_graham_5-1729889964441.png

All gone. πŸ˜Š

 

Same is true for the part structures of iterations 4, 3 and 2, all gone.

ashiq_0978-GravelAuthor
8-Gravel
October 28, 2024

@d_graham  could you please explain this use case and share the code snippet if possible 😊 thanks.

18-Opal
October 28, 2024

@ashiq_097 , I think I already explained exactly what the code does so I'm a bit confused about your asking to "explain this use case".

That said, again, given two arguments, a number and a revision, all iterations of that WTPart's revision have their Part Structure removed.

Isn't that what your post asked for?

 

The utility I wrote does not reclusively go through the entire structure, although that would be easy enough to write.  It only does the top-level structure for the number and revision entered.