Cancel
Showing results for 
Search instead for 
Did you mean: 

Location of a Solver Input File in NX Managed Mode

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

Hi,

 

Using an NXOpen script, I am able, from a SIMSolution, to write the solver input file in Managed Mode. A folder is automatically created "NXSIM-0000007_1" and the solver input file is located in this folder. I have two questions:

 

1) In my case, the folder "NXSIM-0000007_1" is created in the folder where I launch NX using a bat file. But generally, where this folder is located ? Is it driven by an environment variable ? Are we able to modify the location of this folder by setting an environment variable when launching NX ?

 

2) I know that the number "0000007" refers to the part number of the sim file in TeamCenter. I can retrieve that. But from where the "_1" is coming ? It's not related to the sim part revision since in my case, the revision is "A". Furthermore, I obtain sometimes "_3" in the folder name even if the revision is "A". So what is the rule for the folder name ?  "NXSIM-" + "part_number" + what ?

 

Thank you in advance.

 

Regards,

11 REPLIES

Re: Location of a Solver Input File in NX Managed Mode

Esteemed Contributor
Esteemed Contributor

In your NX session, look in the syslog (Menu -> Help -> log file)

See if UGII_TMP_DIR points to that folder

See if any other "temp" variables point to that folder.

 

Ken

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


Re: Location of a Solver Input File in NX Managed Mode

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

Hi Ken,

 

Thanks for your answer. Unfortunately, it is not the UGII_TMP_DIR or other temp folder.

 

I try with the UGII_USER_DIR, but it did not work. Folders are always created in the same folder containing the bat file from which I launch NX.

 

Any idea what it could be ?

 

Thanks.

Re: Location of a Solver Input File in NX Managed Mode

Honored Contributor
Honored Contributor

"Using an NXOpen script, I am able, from a SIMSolution, to write the solver input file in Managed Mode."

 

Does the NXOpen script write this file, or does it call NX commands that write the file? If it calls NX commands, which one does it call and does it behave the same way when using interactive NX?

Re: Location of a Solver Input File in NX Managed Mode

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

Hi write the file by writing this in my script:

 

solution->Solve(SimSolution :: SolveOptionWriteSolverInputFile, SimSolution :: SetupCheckOptionDoNotCheck);

 

It behave the same way using interactive NX.

 

Thanks.

Re: Location of a Solver Input File in NX Managed Mode

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

And any idea from where the number "_x" come in the folder name: NXSIM-00007_x. 00007 is th eitem number in TeamCenter but what is "_x" ?

 

Thanks.

Re: Location of a Solver Input File in NX Managed Mode

Honored Contributor
Honored Contributor

I think the suffix number is generated by TC. If you open a drawing and export a pdf to the dataset, you will see a similar suffix added to the file name. I'd guess that it is added so that any existing file is not over-written.

Re: Location of a Solver Input File in NX Managed Mode

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

Is it possible to retrieve this suffix via NXOpen like we can retrieve the part number and revision ?

 

Thanks.

Re: Location of a Solver Input File in NX Managed Mode

Esteemed Contributor
Esteemed Contributor

The suffix is incremental.

If "_1" exists when you open a part, it will create "_2"

I know for NX CAD/CAM, it creates the temp folders when you open the part, and it creates them in UGII_TMP_DIR - which by default is based on the OS ENV variable "TMP" (NOT "TEMP", although usually at the OS level they point to the same place).

 

So if I open up item ID "ABC123", NX will create %TMP%\ABC123_1

If I (in NX CAM) postprocess an operation, by default it will end up in %TMP%\ABC123_1\

 

If I crash NX (so the folder %TMP%\ABC123_1 doesn't get cleaned up) and I open up ABC123 again, it will create %TMP%\ABC123_2 (and so on, _3, _4, _5 ...)

 

Note above was true in NX7.5/TC2007

 

Starting in NX10/TC11.2 (not sure exactly what version of NX/TC it changed) it is now "ITEM_ID__ITEM_REV____1", e.g. ID="ABC123", rev = "A3", it will be ABC123__A3____1  (yes, 2 underscores and 4 underscores).

 

I'm not sure what CAE uses for its temp folder, but someone at Siemens SHOULD be able to tell you (log a call with GTAC if you don't get an answer here)

 

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


Re: Location of a Solver Input File in NX Managed Mode

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

Thanks Ken.

 

But the folder are not created in the TMP directory. I even try to change the variable UGII_TMP_DIR and the TeamCenter folder are always create at the same location as my batch file from which I launch NX.

 

I figure out that the folder are created in the working directory of the os, which I can get with a call to the windows function GetCurrentDIrectory(). I try to change the current directory with SetCurrentDIrectory, but the team center folders are always created in the initial working directory, whichm in my case, is the folder containing the batch file.

 

For the index, sometime it is _3 even if there is no _1 and _2.

 

So a workaround could be to parse the current directory and check for all folder that start with NXSIM-part_number and select the one having the higher index. I dont like this but it is the only solution I see now.

 

 

Thanks.