Cancel
Showing results for 
Search instead for 
Did you mean: 

API program to put a CAM object attribute to Part attribute

Solution Partner Valued Contributor Solution Partner Valued Contributor
Solution Partner Valued Contributor
Hi guys.
I created a post processor that puts the machining time of the selected PROGRAM to the PROGRAM's object attribute. I can see like "MY_TIME=30 mins"
I want to pull the variable and it's value as a PART attribute, I mean being able to see the same variable when I click File-Properties, attributes.
I will then map that attribute to TEAMCENTER's MENCMaching Revision to see the total machining time in Rich Client.

Cem
4 REPLIES

Re: API program to put a CAM object attribute to Part attribute

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

How does the PP create the attribute (which command)?

 

If you are using a custom DLL, it would be better to let the DLL create the part attribute, which is the easiest.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.1, FBM, MRL 3.1.7 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 11.4
Development: C (ITK), .NET, Tcl/Tk Testing: NX12.0 | AWC 3.4 Preparing: NX12.0

Employees of the customers, together we are strong Smiley Wink
How to Get the Most from Your Signature in the Community
NX Customization - Best Practice Guide

Re: API program to put a CAM object attribute to Part attribute

Solution Partner Valued Contributor Solution Partner Valued Contributor
Solution Partner Valued Contributor

I did it with mom_set_attribute command in the Postbuilder.

Have no experience in programming at all Smiley Happy

Re: API program to put a CAM object attribute to Part attribute

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

The best would be to have a pre-action DLL or VB script that writes the total machining time to the part attribute before saving the part, this is the most reliable way.

Having a PP run and transferring the attribute from the program group to the part is much more complicated.

 

I think there is an existing ER to be able to use mom_set_attribute for part attributes, so you should ask for being attached to that enhancement request.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.1, FBM, MRL 3.1.7 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 11.4
Development: C (ITK), .NET, Tcl/Tk Testing: NX12.0 | AWC 3.4 Preparing: NX12.0

Employees of the customers, together we are strong Smiley Wink
How to Get the Most from Your Signature in the Community
NX Customization - Best Practice Guide

Re: API program to put a CAM object attribute to Part attribute

PLM World Member Valued Contributor PLM World Member Valued Contributor
PLM World Member Valued Contributor
You can use mom_attr_PART_<name> where <name> is the part attribute name you want to write. Will let you read and write the attribute.