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

Relative folder in "ug_list_hlookup" function

Valued Contributor
Valued Contributor

Is it possible to define relative folder for the spreadsheet_name in the "ug_list_hlookup" function ?

if so, how is defined the root folder ?

Thank you for helping me.

P. Serré

4 REPLIES 4

Re: Relative folder in "ug_list_hlookup" function

Siemens Phenom Siemens Phenom
Siemens Phenom

I haven't tried but this may work: https://stackoverflow.com/questions/11629633/how-do-i-make-a-relative-reference-to-another-workbook-...

Regards,
Samadhan

GTAC | NX Help: NX1102 | NX1202 | NX1847
Please mark post as an "Accepted Solution", if it answers your question/is more helpful!

Re: Relative folder in "ug_list_hlookup" function

Valued Contributor
Valued Contributor

Thank you for your answer.

But, my question is about relative path in NX not in Excel.

I wrote the following expressions in NX12 : 

  • MyList = ug_list_hlookup(Filename,"Do (mm)",Range,1,0)
  • Filename = "C:\Data.xlsx"
  • Range = "Feuil1!A1:K63"

All is OK, but I want to define the Filename with a relative path in the same directory as 3D models. When I change  the expression Filename = "C:\Data.xlsx" by Filename = "\Data.xlsx", it does not work anymore !

 

Best Regards

P. SERRE

Re: Relative folder in "ug_list_hlookup" function

Siemens Phenom Siemens Phenom
Siemens Phenom

@serrep ,

 

Create below expression which will give you path of current part file along with part name:

 

filepath=first(mqc_askAssemblyStructure())

You can extract path from above and use it.

Regards,
Samadhan

GTAC | NX Help: NX1102 | NX1202 | NX1847
Please mark post as an "Accepted Solution", if it answers your question/is more helpful!

Re: Relative folder in "ug_list_hlookup" function

Siemens Phenom Siemens Phenom
Siemens Phenom

@serrep , create Filename expression with below value. It will point to excel file kept at part file location.

 

subString(first(mqc_askAssemblyStructure()),0,Length(first(mqc_askAssemblyStructure()))-Length(ug_askCurrentWorkPart()))+"Data.xlsx"

 

Note that you'll need to use "Update for External Change" option to see any changes made later on. 

Regards,
Samadhan

GTAC | NX Help: NX1102 | NX1202 | NX1847
Please mark post as an "Accepted Solution", if it answers your question/is more helpful!