When using KF-based functions, of which the 'ug_askcurrentworkpart()' function is one, if their value/status changes, they do NOT automatically flag any of the downstream NX items, such as expressions, which might reference them, as being changed. Since NX does not know that they have changed, as there was no flag set, there is nothing for NX to do. This behavior is as intended since many of the KF routines still in use today were originally designed to link NX to external items like spreadsheets and databases, and as such, we didn't want NX to be constantly updating everytime someone modified some external spreadsheet or database, which could be referenced by dozens of part files. It was felt that this should be under the full and direct control of the user as to when he wanted his part files to update based on these 'external changes', hence the name given to the update function.
That being said, we have been identifying whether some of these KF routines can be replaced with normal NX functions which would participate in the NX update mechanism as you'd expect them to. For many years we have used, and still do, KF (Knowledge Fusion) to add additional functions to NX which don't always fit into already existing NX functions, and of course users, with the right license and experience, can use KF to create their own special functions which can link data with NX objects or functions, but they again behave like all other KF functions, which is both good and bad, good because once implemented they are indistinguishable from KF routines provided by Siemens PLM, bad because they will have the same limitations and behavior. Now over the years KF has been used to link other NX functions to data that wasn't really external to the Part file, such as Attributes and Expressions for example and these are one of the types of KF routines which have already been replaced with now fully imbedded NX functions. In NX 8.0 we introduced new built-in functions linking Expressions to Attributes and vise versa. Prior to NX 8.0 you had to use KF routines for that and you would also have to use the 'Update for external change' tool to update any of these links between Expressions and Attributes. Starting with NX 8.0, that's no longer necessary, changing an attribute where an expression is set equal to the value of the attribute will now cause the expression to update as if it were edited like any other expression. The same is true for Attributes which have been set to be equal to the value of an Expression.
Anyway, the point I'm trying to make is that we are looking at cases where there is non-exteranl data being linked using KF and we're working on moving those to fully participating NX functions, but it takes time and we need to prioritize the list of potential candidates for updating, so if you think the 'ug_askcurrentworkpart()' function is one that should be considered for being replaced within NX, please contact GTAC and have them open an ER to that effect.
John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Digital Factory
Cypress, CA
Siemens PLM:
UG/NX Museum:
To an Engineer, the glass is twice as big as it needs to be.