cancel
Showing results for 
Search instead for 
Did you mean: 

JAVA: Get the Radius of a circle at an actually Session

Experimenter
Experimenter

Hello everybody,

 

Can you help me to find a method to get the radius of a circle from a pipe at an actually Session.

I had to write a code in JAVA. Compile it and open it as an Execute Open File in NX.

 

I have recorded a Journal from creating a pipe and found the radius declared as the expression3.

I tried to connect the methods i`ve found with the workpart.

 

I` ve already searched at this Forum and searched through the examples in the NX Open Folder.

The NX Documentation is not well- arranged and i have my problems to find something useful.

 

Any assistance on this will be greatly appreciated.

Thank you

5 REPLIES

Re: JAVA: Get the Radius of a circle at an actually Session

Master
Master

Are you try to "get the Radius of a circle" or feature information?

Re: JAVA: Get the Radius of a circle at an actually Session

Experimenter
Experimenter

I try to get the radius of a circle. I mean to say I need the radius as a value like "50".

 

Re: JAVA: Get the Radius of a circle at an actually Session

Master
Master

 

UFSession theUFSess = (UFSession) SessionFactory.get("UFSession");

UFVariant variant = theUFSess.eval().initialize(edge.tag());
UFEval.Arc arcData = theUFSess.eval().askArc(variant);

double r = arcData.radius;

Here is a snip of code how to get data of a solid edge type arc.

 

Re: JAVA: Get the Radius of a circle at an actually Session

Experimenter
Experimenter

Thanks a lot for your help.
But this does not work on a circle?
I have uploaded a foto from the example of a pipe.

From there I need at an actually Session the sketch properties like the radius.

Re: JAVA: Get the Radius of a circle at an actually Session

Master
Master

You have to write your methode how you want to get the arc object tag.

If you set "tag" of the arc in to the "edge.tag" it will work i guess.

The snip code is just a way how to get arc information of a arc object tag. 

Smiley Wink