×
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

ug_setExpressionValue not updating expressions

ug_setExpressionValue not updating expressions

ug_setExpressionValue not updating expressions

(OP)
I am writing a knowledge fusion dfa for controlling the expressions within the current workpart. I am using ug_setExpressionValue to set the value of the expression. I am working joining in the Knowledge Fusion ICE IDE and having NX open with it connected to this dfa file. By changing the values inside of the dfa file and saving the file does not cause the expressions to update. I have to right click on the attribute inside the knowledge fusion tree to get the value to cache.

Any ideas what could be wrong?

I've tried putting a ug_KFUpdate as the last line of the dfa file and still the expressions are not updating themselves.

RE: ug_setExpressionValue not updating expressions

Generally speaking, KF routines do not participate in the normal update mechanism. Making a change using a KF routine does not automatically set a 'change flag' on the items that it's linked to, in this case, the value of an expression. There a couple of things that can be done to force an update, the most reliable being...

Tools -> Update -> Update for External Change

Note that this is one of the reasons why, starting with NX 8.0, that we replaced the use of KF routines for linking Expressions and Attributes with a set of explicit functions available from the Expression and Attribute dialogs. That way they could be fully integrated into the normal NX update mechanism and no longer required any external trigger.

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.

RE: ug_setExpressionValue not updating expressions

(OP)
Hi John,

Thank you for responsing. Yeah...you are right. Knowledge Fusion just like the language it was derived from Scott Heide's AutoCAD Intent! language is a demand drive language. However, the trick here is to force those attributes to be evaluated by using demandValue inside of a child rule. So, the trick is this:

(number parameter) abc: 25 ;

(String modifiable) cWorkPart: ug_askCurrentWorkPart();

(Any Modifiable) AskMyExpAbc: ug_askExpressionValue_(cWorkPart:, "abc");
(Any Modifiable) SetMyExpAbc: ug_setExpressionValue_(cWorkPart:, "abc", format("%8.3f",DS:));

(child) do_it:
{
class ; ug_point ;
suppress?, true ;
demandValue, {AskMyExpAbc: , SetMyExpAbc:} ;
} ;

Back in the mid 90's I use to do write automation code using AutoCAD Intent! when there was no IDE and we were writing code object oriented code in notepad. Then compiling it and fixing it and on and on until we built an entire application. Knowledge Fusion is still a specialized lanugage and even the ICE IDE is not that great. The error message is still not improved in the last 20 years. It is still the same and no intellisense.

Just curious if you know if Siemens is planning of developing more technology into Knowledge Fusion?? Improving the ICE IDE? Improving performance?? It's come along alot since the original intergration back in UG V17. Now, there is associative between the knowledge fusion objects and the ug objects.

Regards.

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