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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Copy attributes from WTPart to WTDocument?

HR_10750679
12-Amethyst

Copy attributes from WTPart to WTDocument?

Hello,

 

I am populating some attributes from CAD to WTPart using Parameters. I want those attributes to be populated to associated WTDocuments as well. Looking for the best solution to achieve the same, please pour your ideas.

 

Thanks,

HS

ACCEPTED SOLUTION

Accepted Solutions

Alias attribute did come to the rescue, achieved my requirement by using the below mapping.

 

describedBy@wt.part.WTPartDescribeLink~describes^wt.xx.PartSubtype~dummy.attributeInternameName

 

I am still investigating the proper use and impacts of using Alias attribute, but the copying of attribute does work with the above mapping. 

View solution in original post

8 REPLIES 8

This is certainly possible through customization. 

 

Create a check-in listener and upon check-in push those attributes from WTPart to WTDocument.

 

Regards

Ajit

Thank you for the response, @Ajit_Kulkarni . I am hesitant to go into customization, I am trying to implement this via configurations itself.

I am also would like to know if any such configuration is available. 

 

In case you need customization this will help. https://community.ptc.com/t5/Windchill/getting-iba-value-from-wtpart-and-setting-wtdocument-iba-via/td-p/585885 

avillanueva
22-Sapphire II
(To:HR_10750679)

I am afraid that this can only be done via customization. There are no build rules like with CAD to Part relationships where attributes are shared and populated. Based on your business rules, you would need to detect check in events for the Part and sync attributes on the related WTDocument, likely with its own check out/in.  I have done something similar but in reverse by hooking into the WTDocument create/edit wizard. Either way, its customization.  The neat thing is that listeners can be added in and taken away so it comes down to a few class files and a line in your .xconf file. Very well documents. One thing you need to account for is the added complexity it introduces. What if the document was checked out? What if attributes are modified in the WTDocument only?  What is your business rule? Make sure all possible exceptions and paths are accounted for.

Can you describe your use case a little more?

We have some workflows where we copy attributes from one object to another. It's not a full customization, but code written into a robot in the workflow.

 

Just did some searching through the Support page.. We've never used Alias Attributes, but it might be just what you're looking for:

Alias Attribute Mapping

 

Alias attribute did come to the rescue, achieved my requirement by using the below mapping.

 

describedBy@wt.part.WTPartDescribeLink~describes^wt.xx.PartSubtype~dummy.attributeInternameName

 

I am still investigating the proper use and impacts of using Alias attribute, but the copying of attribute does work with the above mapping. 

avillanueva
22-Sapphire II
(To:HR_10750679)

Completely forgot about alias attributes. Yes, that would work assuming 1:1. If doc is linked to many Parts, it might not be what you want.

Yes, alias attribute carries duplicate values from different iterations of the part and it looks like it works as per product specification.

 

https://www.ptc.com/en/support/article/CS41608

Announcements

Top Tags