Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IFRs on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to trigger KF attribute when save as

Status
Not open for further replies.

lklo

Industrial
Nov 24, 2010
226
Hi

I have created a new Attribute ( named "lk" )in KF. - see below

@{
$path << first(flatten(ug_askAssemblyStructure( "" )));
ug_setAttrValue_("", "PART_ATTRIBUTE", "filepath", $path);
};


This will set a part attribute named "filepath" and with the value full-path and part name.

It work´s.

But when I do a save as of the part ,the attribute is not updateded. However, if I close the newly "save as" part,and open again,the attribute is updated.
But I need to have it updated at once,without to load the aprt again.
Because I will use the attribute in a Drawing template part,
Maybee someone here can trick?

lklo

 
Replies continue below

Recommended for you

To force an external attribute to update during your NX session, try selecting...

Tools -> Update -> Update for External Change

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
hi again .

It can be used in that way , "Tools -> Update -> Update for External Change".

But , I have read in doc that the possibillity to use a "demandvalue" in addition to tke KF attribute , so the attribute value can be forced updated .
Or am I wrong in that way ?.
If not , maybe someone here know the demandvalue command or how it can be used.?


---------------------
( I have some other part attributes set by the expression editor exmp. ug_setPartAttrValue( "catalog", ("M")+stringValue(p79)+(" x ")+stringValue(p31)).

name = CATALOG
value= M6X20

this attribute is always updated ,when expression p79 or p31 value is changed. )

--------------------

lklo
 
BTW, what version of NX are you running?

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
Hi again ,thank´s .

I´m running NX8.

lklo
 
Is this a legacy file (created prior to NX 8.0)? Starting with NX 8.0 we NO longer recommend that you use the KF routines to set/read attributes with expressions, in fact, the Attribute specific KF routine have been removed from the list of Expression functions (existing files which use these KF routines will still work, but you can't create new ones). I would recommend that you use the NEW (for NX 8.0) built-in expression/attribute routines and STOP using the older KF routines. The new approach is much easier and the update behavior is much better than when using the KF routines.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor