×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Expression Update

Expression Update

Expression Update

(OP)
Okay, so I am experimenting with the ug_setpartattrvalue() formula, I ended up with a lot of attributes that are named incorrectly as my expressions evolved. So I just deleted all of the part attributes, and was wondering if there was a way to rerun or update the ug_setpartattrvalue() expression OTHER THAN using Update for External Change..?

RE: Expression Update

Well, we solved this problem in NX 8.0, but it's not really going to help you much even if you were to upgrade.

Prior to NX 8.0 the only way to share Expressions and Part Attributes was to use the pre-defined KF routines supplied as 'Functions' in the expression system, which is where you found those routines for reading and writing Part Attributes iusing an Expression.  Now the good news that everything that you're doing now will still work (here comes the caveat) JUST AS GOOD AS IT EVER DID.  And to maintain balance in the world, we all know that most of the time, with every 'GOOD' there is also a 'BAD', which means that last statement could have have been written "JUST AS BAD AS IT EVER DID".

Now the approach we took was to NOT tinker with the existing KF functions (with their current limitations) so that any existing legacy parts (created prior to NX 8.0) will be guaranteed to continue to work because we never touched those routines.  What we did instead, to overcome the problems inherent in those old KF routines, was to come-up with a totally new scheme going forward.  These do NOT depend on special functions based on KF routines available in the Expression system but rather provides the user with actual built-in functions allowing Attributes to directly 'read' Expressions (replacing 'ug_setPartAttrValue') and to allow Expressions to directly 'read' Attributes (replacing 'ug_askPartAttrValue').

So now if I want to create an Attribute which will always reflect the value of an Expression (and this will NOT be limited to only 'strings' since we now have Part Attributes which can be 'Integers', 'Reals', 'Dates', 'Booleans' (YES/NO), etc.) all I have to do is create an Attribute using these new options.

And on the Expression side, I now have a set of Functions which will allow me to create 'Attribute Expression' which will always reflect the value of either a Part or Object Attribute.  These 'Attribute Expressions' will behave sort of like the current 'Mass Property Attributes' do now in that they will be 'read-only' and they will be presented in a special format/color so that they are easy to find and recognize.

However, this DOES mean that we are going to REMOVE the two  Attribute functions based on the KF routines from the Expression system since we want you to use the new approach as they will properly update without having to use sledgehammer like 'Update for External Change'.  This will be no different than now when I edited a numerical Expression and my model updates.

Now, as I stated before, if you have any existing pre- NX 8.0 part files where you've used one or both of those old KF routines, they will continue to work, but you will still have the current update issues since we have not touched that code, just made it so that you can't create and new parts using what are now 'obsolete' functions, but we will keep them working "JUST AS GOOD/BAD AS THEY EVER DID" in perpetuity.

Anyway, I hope that helps explain the situation.

And as for your actual question, NO, what you have now is as good as it is.  But we fixed it in NX 8.0, but only if you create new Attributes/Expressions.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
UG/NX Museum:   http://www.plmworld.org/p/cm/ld/fid=209

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

RE: Expression Update

(OP)
Ahh, that is good information to know.  We are just now starting a huge automation push, and if those changes are in 8.0, before we start setting up all of our files with these "old" KF functions we might want to look at upgrading to 8.0 so we can use the new functionality...

RE: Expression Update

And since we've made a lot of other changes to Attributes in general, besides making them more usable with Expressions, you really need to look at all of what we've done in NX 8.0 in these areas (we also made some minor changes in Expressions in addition to the Attribute stuff).

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
UG/NX Museum:   http://www.plmworld.org/p/cm/ld/fid=209

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

RE: Expression Update

(OP)
Okay, I just learned that we have an 8.0 disk floating around that I can install and play with to see if it is worth upgrading our department to 8.0 for this. Which it sounds like it might be.  Thanks for all the info!

RE: Expression Update

NX8.0.1

Following up on the OP, is there a way to have the function:

ug_askCurrentWorkPart()

when implemented within the NX Expression dialogue, update automatically anytime the part is Opened or Save-As performed?

Currently it appears that the default behavior is for this function to not update unless you do something like "Update for External Change", or manually edit the expression and re-enter it.

Thanks.

RE: Expression Update

As I alluded to in my first response above, there are issues with respect to how the Expression system deals with KF routines (your 'ug_askCurrentWorkPart()' is a KF function) particularly when there was a change somewhere else in the system for which the KF routine was providing information to the Expression system or the KF routine was being used to supply Expression data to some other part of NX and one of these is that they do not immediately update when changes are made.  Now there are several reasons for that and while the system will eventually catch-up with itself, we have provide a way to force that update, by using the 'Update for External Change' for example.

The NX 8.0 project by which we replaced having to depend on KF routines for sharing data between Attributes and Expressions was done so as to overcome this behavior since it was deemed critical for the role which we expect users would like Attributes to play once we had implemented the general Attribute enhancements that we did for NX 8.0.  We decided to go the route we did rather than trying to rearchitect the KF code as that would have required a lot more work for very little gain.  Besides, if you're going to try and alter the behavior of a sub-set of KF routines without taking on the task of changing ALL of them, this presents its own set of unique problems so we went the route that we did.

So the bottom line is that, even with the changes that we made in NX 8.0, the behavior of KF routines used in an Expression has NOT changed.

Now that we've got that out-of-the-way, exactly what are you expecting to even USE this 'ug_askCurrentWorkPart()' Expression FOR?  After all, once a part is open which contains this Expression, the ONLY thing that you can do to actually CHANGE what the value would be is to do a 'Save-As'.  What's next?

Anyway, I hope this helps explain what is and what is not happening.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
UG/NX Museum:   http://www.plmworld.org/p/cm/ld/fid=209

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources