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

MP(Maintenance Pack) output

Hello.

Is there a way to get the MP(Maintenance Pack) level on the same line as the NX version….?

 

MOM_output_literal "(NX VERSION   : ${mom_ug_version})"

 

 

Current posted output...

(NX VERSION        : NX 9.0.3.4)

 

 

Desired posted output...

(NX VERSION        : NX 9.0.3.4 MP12)

 

 

Kal.

NX 9.0.3.4 MP12
PB 9.0.3.2
Vericut7.3.4
13 REPLIES

Re: MP(Maintenance Pack) output

The only way I know of is using an API program to parse the syslog. See https://community.plm.automation.siemens.com/t5/NX-Programming-Customization/Get-current-NX-Version-...

Mark Rief
Retired Siemens
Solution
Solution
Accepted by topic author Kal
‎02-13-2017 12:27 PM

Re: MP(Maintenance Pack) output

Below find some Tcl code that I use as a custom function in MKE to determine the exact NX release.

    global HAI_current_NX_release

    set outputFile [file nativename "[MOM_ask_env_var UGII_TMP_DIR]\\env_print_out.txt"]
    set HAI_current_NX_release ""

    exec "[MOM_ask_env_var UGII_ROOT_DIR]\\env_print.exe" -m >$outputFile

    if { [file exists $outputFile] == 0 } {
      exec "[MOM_ask_env_var UGII_ROOT_DIR]\\env_print.exe" -n >$outputFile
    }

    if { [file exists ${outputFile}] == 1 } {
      set fileHandle [open $outputFile]
      set HAI_current_NX_release [read $fileHandle]
      close $fileHandle
    }

    set PosComma [string first "," $HAI_current_NX_release]
    if { $PosComma > 0 } {
      set HAI_current_NX_release [string range $HAI_current_NX_release 0 [expr $PosComma - 1]]
    } else {
      set HAI_current_NX_release [string trim $HAI_current_NX_release]
    }

    MOM_log_message "Current NX Release ... $HAI_current_NX_release"
Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: MP(Maintenance Pack) output

If you wish to redirect exit status on a variable, without passing by opening a file. You can make like that also :

set NXversion_number [exec $env(UGII_ROOT_DIR)env_print.exe -n]
set NXpatch [exec $env(UGII_ROOT_DIR)env_print.exe -m]

 

@mkn

Re: MP(Maintenance Pack) output

Note there is an existing ER 7915944 (Stefan?) to get this MP info as an ENV variable (similar to UGII_FULL_VERSION)

 

I have an IR 7916250 (closed as a duplicate to IR  7916249) to have ENVs that include Hotfix / patch info as well.

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: MP(Maintenance Pack) output

Thank you all for your contributions....

Stefan's cc is what I ended up using.  Thanks Stefan!Smiley Happy

 

Kal.

NX 9.0.3.4 MP12
PB 9.0.3.2
Vericut7.3.4

Re: MP(Maintenance Pack) output

[ Edited ]

Thanks @Stefan_Pendl - very clever. I was not aware of the -m switch for env_print.

In NX11 there is no more UGII_ROOT_DIR, so I changed those references to UGII_BASE_DIR\\ugii:

 

 

    exec "[MOM_ask_env_var UGII_BASE_DIR]\\ugii\\env_print.exe" -m >$outputFile

 

 

 

 

 

Mark Rief
Retired Siemens

Re: MP(Maintenance Pack) output

Stefan,

Some of my colleagues, no MP on their computers, when they post, NX base version does not show...any ideas how to fix this?

 

; POST PROCESSOR   : GROB-G550
; PROGRAMMED BY  : Bugs Bunny
; NX VERSION            :
; DATE                         : Mon Feb 13 15:06:46 2017

 

 

Kal.

NX 9.0.3.4 MP12
PB 9.0.3.2
Vericut7.3.4

Re: MP(Maintenance Pack) output

Did you use all of @Stefan_Pendl's tcl sample, or just the env_print -m command? The sample first tries -m to get the HFor MP. If that is null, then it uses -n to get the release. 

Mark Rief
Retired Siemens

Re: MP(Maintenance Pack) output

Mark. Used the entire code...

NX 9.0.3.4 MP12
PB 9.0.3.2
Vericut7.3.4

Learn online





Solution Information