Get WTPart attribute for associated EPM model OR drawing
Version: Windchill 13.0
Use Case: Working on getting specific WTPart attributes overlaid on published drawing PDFs.
Description:
I thought this would be simple enough but I ended up struggling the last two days in trying to achieve the following:
- Code collects and makes available an EPMDocument ID. βοΈ
- EPMDocument could be either a drawing or a model and it will have an associated WTPart.
If this is a drawing:
- tried this from the community: How to retrieve drawing that references an EPMDocument from Java . This does the reverse and gets the drawing from a model. Ok. So I figured I'd do the reverse and use the
EPMStructureHelper.service.navigateReferences(etc etc)
instead... from here I can't resolve either the EPMReferenceLink IDs or the EPMDocumentMasters (depending on the boolean settings) to get the related model.
It's not clear to me where to go to get the "rolename" values or "buildrule" integer values to be able to go directly from the drawing to the WTPart. That would be ideal.
There's CS351622 that goes over how to fetch an owner linked WTPart. Assuming here that if I change "OWNER" to "IMAGE" or "CALCULATED" (?) this may give me what I want?
I just feel like I'm missing some pretty important pages from some customization guide somewhere...

