Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

mom_attr_TOOL_<name> or ug_setAttrValue_

During the post execution I'm building a Tool Code based on the various tool parameters. (For example a 1/2" endmill would yield something like EM-0-5000, etc.)  I'd like to write the resulting Tool Code value back to the Description field in the Tool dialog box if at all possible.  Could I use something like ug_setAttrValue_ to do this?  I think this would be preferred since I could then capture the code in the Tool Library.

 

If I can't write the value back to the Description Field, can I programatically add a tool attribute and write a value to it using mom_attr_TOOL_?  I've tried this using

 

global mom_attr_TOOL_CODE

set mom_attr_TOOL_CODE $tool_code

 

but I don't get a value to populate the attribute?    

12 REPLIES

Re: mom_attr_TOOL_<name> or ug_setAttrValue_

Variables at post time are populated from the CAM part file. but are not live. Nothing will be written back to the part.

global mom_attr_TOOL_CODE
set mom_attr_TOOL_CODE $tool_code

will change the value of mom_attr_TOOL_CODE and this will be available throughout the current execution of ugpost ,
ie you can overwrite or create any variable during the life of the post execution

To write information back to the part file would require an extension to the translator written in ufunc/ugopen.

It is possible to to write to the tool description or attributes with ufunc.

I'm not sure this would be a great idea. The part file should control the posted output.
How would different posts interact with this information, would it be overwritten every time, or used if it existed and created if not?

If this information is based on tool parameters then duplicating it in the part file is redundant.

my 2c




Solution
Solution
Accepted by topic author David_Ellison
‎08-26-2015 04:32 AM

Re: mom_attr_TOOL_<name> or ug_setAttrValue_

[ Edited ]

To modify the description field of the NX tool object, you need to use the API.

 

You can however define an attribute for your own description. This command sets attributes on CAM objects from the postprocessor:

 

MOM_set_attribute <object_name> <attribute_title> <attribute information array>. 

 

There are examples in the help of using this in shop docs or post builder to save the name ot thepostprocessor output file with the Program Group, but it is a general function and can assign any attribute to any CAM object in the Operation Navigator.

Mark Rief
Retired Siemens

Re: mom_attr_TOOL_<name> or ug_setAttrValue_

RE: MOM_set_attribute

 

What version of NX was this added in?

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: mom_attr_TOOL_<name> or ug_setAttrValue_

[ Edited ]

Ken_A wrote:

RE: MOM_set_attribute

 

What version of NX was this added in?


Officially, NX9, but we did it in late 2012, so if might be in a 8.5 MR.
Mark Rief
Retired Siemens

Re: mom_attr_TOOL_<name> or ug_setAttrValue_

Mark,

 

Thanks for the info.  Forgive me, I'm new to NX and I'm having trouble finding information on the MOM_set_attribute command in the documentation.  I was able to use the command to create an attribute in the Tool Properties but unable to assign the attribute a value.  I don't think I have the proper syntax for the <attribute information array>.  Do you have a piece of sample code to share?  Thanks!

Re: mom_attr_TOOL_<name> or ug_setAttrValue_

Mark,

 

I found the syntax in another post.  Thanks for the info!

 

-David

Re: mom_attr_TOOL_<name> or ug_setAttrValue_

Can you only use the MOM_set_attribute command to write attributes to the operation object? I tried writing an attribute to the Tool object but got an error?

 

-David

Re: mom_attr_TOOL_<name> or ug_setAttrValue_

See the NX 9.0 help file under topic What's new in NX 9.0 => CAM => NX Post => Adding CAM attributes for shop documentation in the post.

 

It seems that only program groups and operations are supported.

 

To add more supported objects, you would have to file an enhancement request at GTAC.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: mom_attr_TOOL_<name> or ug_setAttrValue_

Thanks Stefan!

Learn online





Solution Information