Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

ug_setExpressionValue not updating expressions

Status
Not open for further replies.

EngProgrammer

Aerospace
Joined
Jan 14, 2015
Messages
150
Location
US
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.
 
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.
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top