Cancel
Showing results for 
Search instead for 
Did you mean: 

MOM_run_user_function

Valued Contributor
Valued Contributor

Hello everyone,

 

I have attached several Partattributes to my CAM-File and check them in the PP run.

If they are missing I will call a custom DLL file with MOM_run_user_function.

That DLL will bring up an GUI to add those attributes.

 

Everything is working fine so far, BUT:

 

When the GUI shows and the user adds the missing attributes, is there anyway to

continue the PP run and "reread" those Partattributes?

I tried it with MOM_reload_variable after the DLL call, but the syslog tells me:

MOM_reload_variable could not find variable mom_attr_PART_CUSTOM_ATTRIBUTE in Interpreter

 

(I am using NX12.0.1 MP2)

5 REPLIES 5

Re: MOM_run_user_function

Siemens Genius Siemens Genius
Siemens Genius

Maybe the variables and part attributes are populated in pp while it is launched. if so, you can always write the attributes in a text file and then reread them in pp from the text files.

 

Just an idea or workaround

Re: MOM_run_user_function

Phenom
Phenom
Because the attributes don't exist at run time of the post you will have to create & set the tcl variables

Have you looked at UF_MOM_set_string and its variants

Or the function could return a list of attribute names and value pairs then you can create them with tcl.

Re: MOM_run_user_function

Valued Contributor
Valued Contributor

Hello,

 

I had to stop that project for some days.

I think I will use the temp. textfiles to fix that problem.

I also will take a look at the UF_MOM part, didn't know that this exists :-)

 

Thanks everyone!

Re: MOM_run_user_function

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

No need to create the text file.

As you know the attribute name, you can set your own global variable with that name

 

global mom_attr_PART_ABC
global wt_attribute_title  "ABC"
global wt_attribute_value "123"

if {![info exists mom_attr_PART_ABC]} {
    # Call code to set attribute in the part
    set mom_attr_PART_ABC $wt_attribute_value 
}
Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled


Highlighted

Re: MOM_run_user_function

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

As an aside on part attribute variables -

I have had issues with them NOT being set when posting from the sync manager (even though the attribute is set in the part).

I have a PR on it, I don't know if/when it was fixed (I added my own code that if the mom_attr_PART_* doesn't exist, then I run an API program to define it for me, so I just haven't bothered looking in a long time)

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


Learn online





Solution Information