Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

Knowledge Fusion - %ui_comp_point

I’m using %ui_comp_point within my KF code to allow users to select a starting point to build some geometry. Everything seems to be working, but I’ve noticed that the point that gets selected isn’t automatically updated as my model updates.

 

e.g. LINE_A starts at (0,0,0) and ends at (0,0,5). The user selects the endpoint of LINE_A as uiPoint1 in KF. When LINE_A is updated to start at (0,0,0) and end at (0,0,8) I would expect that uiPoint1 would automatically update to (0,0,8). Instead, uiPoint1 continues to exist at its original value of (0,0,5) and doesn’t update until I manually reselect the endpoint of LINE_A as uiPoint1.

 

Does anyone know what I’m missing or doing wrong? I’ve included the code I’ve written for the point selection below.

 

Thanks,

Chris

 

(point modifiable) uiPoint1: point(0,0,0);

 

(child) uiSelectPoint: {

class, %ui_comp_point;

labelString, "Select Point or Object";

point, uiPoint1:;             

soUpdateOption, 3;                     

scope, 1; NoHandle, false;                       

LabelString, "Point";                    

GwifType, 0;                                   

};

2 REPLIES
Solution
Solution
Accepted by JerrySarfati (Siemens Legend)
‎08-26-2015 04:32 AM

Re: Knowledge Fusion - %ui_comp_point

Chris,

The problem here is that the way the points are used is mixed up. When specifying the point parameter for %ui_comp_point the argument you pass is the default value. So passing the uiPoint: variable is just saying "use the value of this point as the default", but when you select a point it will not transfer the value into the uiPoint: variable.

 

Instead, what you need to do is set the uiPoint: variable to the value of the point parameter for the %ui_comp_point child. So your code should look like more this:

(point modifiable) uiPoint1: uiSelectPoint:point:;
 
(child) uiSelectPoint: {
  class, %ui_comp_point;
  labelString, "Select Point or Object";
  point, point(0,0,0);             
  soUpdateOption, 3;                     
  scope, 1; NoHandle, false;                       
  LabelString, "Point";                    
  GwifType, 0;                                   
};

NOTE: The uiSelectPointSmiley Tongueoint: gets an emoticon inserted in it because of the : and p together. To be absolutely clear it should be as follows (but with spaces between each character to avoid the emoticon):

u i S e l e c t P o i n t : p o i n t :

 

Hope this helps.

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5

Re: Knowledge Fusion - %ui_comp_point

Ah!  I see what I did wrong now.  Thanks so much for your help, Graham!