cancel
Showing results for 
Search instead for 
Did you mean: 

Pass UDE selected points coordinates to PB command

Hi

 

I created a UDE to select points. The UDE definition syntaxes are as simple as the followings:  

 

 

PARAM probe_point_p1
   {
      TYPE p
      UI_LABEL "First Point"
   }
   PARAM probe_point_p2
   {
      TYPE p
      UI_LABEL "Second Point"
   }

Later, I tried to output the information of the points. So I attached a user command to the UDE with the following code:

 

 

 

    global mom_probe_point_p1
    MOM_output_literal $mom_probe_point_p1

 

NX gives me an error, saying that 

 

Can't read "mom_probe_point_p1: variable is array while exectuing MOM_output_literal"

 

Well, fair enough. So then I tried the following

 

 

global mom_probe_point_p1(0)
MOM_output_literal $mom_probe_point_p1

 

or 

 

 

global mom_probe_point_p1
MOM_output_literal $mom_probe_point_p1(0)

 

Now,both gave me errors suggesting that the variable $mom_probe_point_p1 is not an array. 

It feels like it contradicts itself! 

 

Does anyone know how to read the coordinate information of UDE selected points?

 

Thanks in advance.

 

Stephan 

 

 

 

 

 

7 REPLIES

Re: Pass UDE selected points coordinates to PB command

Phenom
Phenom

You could turn on the review tool and look for the ude event. There you will see the variable names.

NX10.03
Windows 7 Pro

Re: Pass UDE selected points coordinates to PB command

I've tried it. Say if I select a point (0,0,100), under review tool, I  can see the following:

 

mom_probe_point_p1(0) = 0

mom_probe_point_p1(1)= 0

mom_probe_point_p1(2)= 100

 

What is bizzared is that when I say 

 

global mom_probe_point

MOM_output_literal $mom_probe_point(0)

 

it gives me error, saying mom_probe_point is not an array.

 

 

 

Re: Pass UDE selected points coordinates to PB command

I tried it in NX 7.5 and it works simply by writting

 

global mom_probe_point_p1

MOM_output_literal $mom_probe_point_p1(0)

 

and it works.

 

So I confirmed that this is another bug with my NX 8.5.

Re: Pass UDE selected points coordinates to PB command

Phenom
Phenom

Maybe so (a bug) but 8.5.2.3 is ok I think - I use point in ude.

NX10.03
Windows 7 Pro

Re: Pass UDE selected points coordinates to PB command

We haven't changed the mom variables from the point UDE.

I would guess there is more thourough error checking in newer versions of tcl.

Mark Rief
Retired Siemens

Re: Pass UDE selected points coordinates to PB command

Phenom
Phenom

Is it becuse of variable names

 

In the review tool  the variable is "mom_probe_point_p1"

 

And the code to output is calling a variable named "mom_probe_point"

 

Re: Pass UDE selected points coordinates to PB command

Esteemed Contributor
Esteemed Contributor

Stephan_Spears wrote:

I've tried it. Say if I select a point (0,0,100), under review tool, I  can see the following:

 

mom_probe_point_p1(0) = 0

mom_probe_point_p1(1)= 0

mom_probe_point_p1(2)= 100

 

What is bizzared is that when I say 

 

global mom_probe_point                                  <== does not include "_p1"

MOM_output_literal $mom_probe_point(0)      <== does not include "_p1"

 

it gives me error, saying mom_probe_point is not an array.

 

 

 


Did you try

global mom_probe_point_p1
MOM_output_literal $mom_probe_point_p1(0)
Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Learn online





Solution Information