Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

NXopen Java Multisession

Creator
Creator

Hello,

 

I'm new in NX (11v) and NXopen. I'm trying to modifye a 3D NX Model template and a 2D Sketch.

I do erverything in Java and without starting NX itself. But i think the progrmmlanguage shoudnt be the problem.

I edit some Expressions and save the .prt some where else.

Now my Problem is, i want to run 3DModel editing and 2DSketch simultaneously.

One after One spereated is no problem. But so i have to quit the programm ervery time.

If i run it simultaneously i have Problem with my Session in one JVM (Java Virtual Machine) . I create the Sesseion und the UFSeffeion with the Session Factory.

 

UFSession ufSession = (UFSession) SessionFactory.get("UFSession");
Session theSession= (Session) SessionFactory.get("Session");

Is there anyway I can create a new Session?

Something like:

Session theSession2 = (Session) SessionFactory.get("Session2");

So i can separete the 3D Session an the 2D Session in one JVM?

 

Thnk you for your Support.

Production: NX11.0.2 TeamCenter 11.3.0.1
Development: Java Testing: NX11.0.2 Preparing: NX11.0.2 TeamCenter 11.3.0.1
6 REPLIES 6

Re: NXopen Java Multisession

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

There is always only one NX session, this is how it works interactively too.

You will then use the API methods of one or the other application (modeling, drafting, sketch, etc.) to manipulate the objects, no need to change applications or have multiple sessions.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.2, FBM, MRL 3.1.7 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 11.4
Development: C (ITK), .NET, Tcl/Tk Testing: NX12.0 | AWC 3.4 Preparing: NX12.0

Employees of the customers, together we are strong Smiley Wink
How to Get the Most from Your Signature in the Community
NX Customization - Best Practice Guide

回复: NXopen Java Multisession

Experimenter
Experimenter

Hello SamEro,

 

Can I ask you a question?

I want to do  erverything in Java  through Eclipse and without starting NX itself,but I have a problem.

 

java.lang.UnsatisfiedLinkError: D:\ug\UG8.5\UGII\libnxopenjavacore.dll: Can't find dependent libraries

 

How do you use Eclipse for Java development?

 

Thank you very much

回复: NXopen Java Multisession

Creator
Creator
Hey,

Are you familiar with importing Lib´s into your Eclipse Project?
If not here is a simple desciption:
http://www.oxfordmathcenter.com/drupal7/node/44

To your Problem. You have tried to import a dll. But that is not a Java lib. You can import dll for coding with VB or C#.
In Java your external lib is .jar type.

In NX 11 i found my lib in "\NXBIN" folder.
For my usage, i have imported :
NXOpen.jar
NXOpenRun.jar
NXOpenUF.jar
NXOpenUFRemote.jar
NXOpenUFRun.jar
NXOpenUI.jar
NXOpenUIRemote.jar
NXOpenUIRun.jar

Hope this will answer your question.
Production: NX11.0.2 TeamCenter 11.3.0.1
Development: Java Testing: NX11.0.2 Preparing: NX11.0.2 TeamCenter 11.3.0.1

回复: NXopen Java Multisession

Experimenter
Experimenter

是的,我已经导入了所有库;

NXOpen.jar
NXOpenRun.jar
NXOpenUF.jar
NXOpenUFRemote.jar
NXOpenUFRun.jar
NXOpenUI.jar
NXOpenUIRemote.jar
NXOpenUIRun.jar

but if i don't import dll, Eclipse will make an error:

Caused by: java.lang.UnsatisfiedLinkError: no libnxopenjavacore in java.library.path

 

if i import dll,I'll have an error:

Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\Siemens\NX 9.0\UGII\libnxopenjavacore.dll: 

 

 

you only import libs,it's all right?No other system variables configured?


I have the same problem:

https://community.plm.automation.siemens.com/t5/CAE-Simulation-Simcenter-3D-Forum/NX-Open-using-Java...

 

It's driving me crazy,I tried many ways, but none of them solved the problem;Do you have any good ideas?

 

Thanks and best regards.

回复: NXopen Java Multisession

Creator
Creator

Yes you are right. I forgot about the  system variables. Here a pic of mine: SysVar.PNG

Production: NX11.0.2 TeamCenter 11.3.0.1
Development: Java Testing: NX11.0.2 Preparing: NX11.0.2 TeamCenter 11.3.0.1

回复: NXopen Java Multisession

Experimenter
Experimenter

I  want to make a software,that can parse .prt file,I can get the data in the file,for example,height of a cube.Software don't depend on UG. 

 

And I set all system variables, the problem remains. I don't think system variables affect java code in Eclipse.