NX Open C++ Reference Guide
|
Represents a class for interacting with spreadsheets. More...
Public Types | |
enum | LookupMode { LookupModeExact, LookupModeHigher, LookupModeLower, LookupModeClosest } |
Modes of lookup in the table. More... | |
enum | OpenMode { OpenModeRead, OpenModeWrite } |
Sheet types to open spreadsheet. More... | |
enum | Sheettype { SheettypeGateway, SheettypeModeling, SheettypePartfamily } |
Sheet types to open spreadsheet. More... | |
Public Member Functions | |
NXOpen::SpreadsheetCellData * | CreateCellData () |
Creates SpreadsheetCellData object. More... | |
NXString | ExportFile (const NXString &partnum) |
In NX/MGR mode, export an Excel spreadsheet file from the dataset file stored in the Teamcenter database to the native file system. More... | |
NXString | ExportFile (const char *partnum) |
In NX/MGR mode, export an Excel spreadsheet file from the dataset file stored in the Teamcenter database to the native file system. More... | |
NXOpen::SpreadsheetCellData * | HorizontalLookup (const NXString &file, const NXString &target, const NXString &range, int offset, NXOpen::SpreadsheetManager::LookupMode mode) |
Reads the value from a given spreadsheet using a horizontal table lookup. More... | |
NXOpen::SpreadsheetCellData * | HorizontalLookup (const char *file, const char *target, const char *range, int offset, NXOpen::SpreadsheetManager::LookupMode mode) |
Reads the value from a given spreadsheet using a horizontal table lookup. More... | |
NXOpen::Spreadsheet * | Open (NXOpen::SpreadsheetManager::Sheettype sheettype, const NXString &partfile) |
Opens excel sheet associated with given part file. More... | |
NXOpen::Spreadsheet * | Open (NXOpen::SpreadsheetManager::Sheettype sheettype, const char *partfile) |
Opens excel sheet associated with given part file. More... | |
NXOpen::SpreadsheetExternal * | OpenFile (const NXString &sheet, NXOpen::SpreadsheetManager::OpenMode mode) |
Opens an Excel spreadsheet file. More... | |
NXOpen::SpreadsheetExternal * | OpenFile (const char *sheet, NXOpen::SpreadsheetManager::OpenMode mode) |
Opens an Excel spreadsheet file. More... | |
NXOpen::SpreadsheetCellData * | ReadAny (const NXString &filename, const NXString &cell) |
Reads value in a given cell, from a given spreadsheet. More... | |
NXOpen::SpreadsheetCellData * | ReadAny (const char *filename, const char *cell) |
Reads value in a given cell, from a given spreadsheet. More... | |
NXOpen::SpreadsheetCellData * | ReadCell (const NXString &filename, const NXString &cell) |
Reads value in a given cell, from a given spreadsheet. More... | |
NXOpen::SpreadsheetCellData * | ReadCell (const char *filename, const char *cell) |
Reads value in a given cell, from a given spreadsheet. More... | |
tag_t | Tag () const |
Returns the tag of this object. More... | |
NXOpen::SpreadsheetCellData * | VerticalLookup (const NXString &file, const NXString &target, const NXString &range, int offset, NXOpen::SpreadsheetManager::LookupMode mode) |
Reads the value from a given spreadsheet using a vertical table lookup. More... | |
NXOpen::SpreadsheetCellData * | VerticalLookup (const char *file, const char *target, const char *range, int offset, NXOpen::SpreadsheetManager::LookupMode mode) |
Reads the value from a given spreadsheet using a vertical table lookup. More... | |
Represents a class for interacting with spreadsheets.
There are different types of methods to use the APIs from this class.
For interacting with the spreadsheet associated with a part file, use Spreadsheet object returned by NXOpen::SpreadsheetManager::Open For interacting with external spreadsheet, use Spreadsheet object returned by NXOpen::SpreadsheetManager::OpenFile .
To obtain an instance of this class, refer to NXOpen::Session
Usable only on Windows
Created in NX11.0.0.
NXOpen::SpreadsheetCellData* NXOpen::SpreadsheetManager::CreateCellData | ( | ) |
Creates SpreadsheetCellData object.
In NX/MGR mode, export an Excel spreadsheet file from the dataset file stored in the Teamcenter database to the native file system.
The file is exported for readnig only.
Note: For dataset file stored in the Teamcenter database, the spreadsheet must be stored as a MSExcel or MSExcelX dataset. The dataset shall be attached to its containing item revision with an IMAN_specification relation. Up to one MSExcel or MSExcelX dataset can be attached.
In Native mode, it does nothing and always returns an empty string.
Created in NX11.0.0.
License requirements : None
partnum | A part number containing a MsExcel dataset. |
NXString NXOpen::SpreadsheetManager::ExportFile | ( | const char * | partnum | ) |
In NX/MGR mode, export an Excel spreadsheet file from the dataset file stored in the Teamcenter database to the native file system.
The file is exported for readnig only.
Note: For dataset file stored in the Teamcenter database, the spreadsheet must be stored as a MSExcel or MSExcelX dataset. The dataset shall be attached to its containing item revision with an IMAN_specification relation. Up to one MSExcel or MSExcelX dataset can be attached.
In Native mode, it does nothing and always returns an empty string.
Created in NX11.0.0.
License requirements : None
partnum | A part number containing a MsExcel dataset. |
NXOpen::SpreadsheetCellData* NXOpen::SpreadsheetManager::HorizontalLookup | ( | const NXString & | file, |
const NXString & | target, | ||
const NXString & | range, | ||
int | offset, | ||
NXOpen::SpreadsheetManager::LookupMode | mode | ||
) |
Reads the value from a given spreadsheet using a horizontal table lookup.
The Excel spreadsheet to be opened could be either from the native file system, or from the dataset file stored in the Teamcenter database.
Note: The mode works when the target cell contains only numeric values and the mode is ignored when the target cell contains text
file | File name with full path |
target | Lookup target |
range | Table range |
offset | The offset to the data cell. |
mode | The mode of lookup in the table. |
NXOpen::SpreadsheetCellData* NXOpen::SpreadsheetManager::HorizontalLookup | ( | const char * | file, |
const char * | target, | ||
const char * | range, | ||
int | offset, | ||
NXOpen::SpreadsheetManager::LookupMode | mode | ||
) |
Reads the value from a given spreadsheet using a horizontal table lookup.
The Excel spreadsheet to be opened could be either from the native file system, or from the dataset file stored in the Teamcenter database.
Note: The mode works when the target cell contains only numeric values and the mode is ignored when the target cell contains text
file | File name with full path |
target | Lookup target |
range | Table range |
offset | The offset to the data cell. |
mode | The mode of lookup in the table. |
NXOpen::Spreadsheet* NXOpen::SpreadsheetManager::Open | ( | NXOpen::SpreadsheetManager::Sheettype | sheettype, |
const NXString & | partfile | ||
) |
Opens excel sheet associated with given part file.
And returns a Spreadsheet object.
sheettype | Sheet type |
partfile | Part file |
NXOpen::Spreadsheet* NXOpen::SpreadsheetManager::Open | ( | NXOpen::SpreadsheetManager::Sheettype | sheettype, |
const char * | partfile | ||
) |
Opens excel sheet associated with given part file.
And returns a Spreadsheet object.
sheettype | Sheet type |
partfile | Part file |
NXOpen::SpreadsheetExternal* NXOpen::SpreadsheetManager::OpenFile | ( | const NXString & | sheet, |
NXOpen::SpreadsheetManager::OpenMode | mode | ||
) |
Opens an Excel spreadsheet file.
The type of the access mode can be either Read, or Write. The Excel spreadsheet to be opened could be either from the native file system, or from the dataset file stored in the Teamcenter database.
Note: For dataset file stored in the Teamcenter database, the spreadsheet must be stored as a MSExcel or MSExcelX dataset. The dataset shall be attached to its containing item revision with an IMAN_specification relation. Up to one MSExcel or MSExcelX dataset can be attached.
sheet | An external Excel file name |
mode | Mode read/write |
NXOpen::SpreadsheetExternal* NXOpen::SpreadsheetManager::OpenFile | ( | const char * | sheet, |
NXOpen::SpreadsheetManager::OpenMode | mode | ||
) |
Opens an Excel spreadsheet file.
The type of the access mode can be either Read, or Write. The Excel spreadsheet to be opened could be either from the native file system, or from the dataset file stored in the Teamcenter database.
Note: For dataset file stored in the Teamcenter database, the spreadsheet must be stored as a MSExcel or MSExcelX dataset. The dataset shall be attached to its containing item revision with an IMAN_specification relation. Up to one MSExcel or MSExcelX dataset can be attached.
sheet | An external Excel file name |
mode | Mode read/write |
NXOpen::SpreadsheetCellData* NXOpen::SpreadsheetManager::ReadAny | ( | const NXString & | filename, |
const NXString & | cell | ||
) |
Reads value in a given cell, from a given spreadsheet.
The Excel spreadsheet to be opened could be either from the native file system, or from the dataset file stored in the Teamcenter database.
filename | File name with full path |
cell | Cell number can contain the worksheet along with the cell number by separating the two fields with an exclamation mark. For example: Sheet1!A1 |
NXOpen::SpreadsheetCellData* NXOpen::SpreadsheetManager::ReadAny | ( | const char * | filename, |
const char * | cell | ||
) |
Reads value in a given cell, from a given spreadsheet.
The Excel spreadsheet to be opened could be either from the native file system, or from the dataset file stored in the Teamcenter database.
filename | File name with full path |
cell | Cell number can contain the worksheet along with the cell number by separating the two fields with an exclamation mark. For example: Sheet1!A1 |
NXOpen::SpreadsheetCellData* NXOpen::SpreadsheetManager::ReadCell | ( | const NXString & | filename, |
const NXString & | cell | ||
) |
Reads value in a given cell, from a given spreadsheet.
The Excel spreadsheet to be opened could be either from the native file system, or from the dataset file stored in the Teamcenter database.
filename | File name with full path |
cell | Cell number can contain the worksheet along with the cell number by separating the two fields with an exclamation mark. For example: Sheet1!A1 |
NXOpen::SpreadsheetCellData* NXOpen::SpreadsheetManager::ReadCell | ( | const char * | filename, |
const char * | cell | ||
) |
Reads value in a given cell, from a given spreadsheet.
The Excel spreadsheet to be opened could be either from the native file system, or from the dataset file stored in the Teamcenter database.
filename | File name with full path |
cell | Cell number can contain the worksheet along with the cell number by separating the two fields with an exclamation mark. For example: Sheet1!A1 |
tag_t NXOpen::SpreadsheetManager::Tag | ( | ) | const |
Returns the tag of this object.
NXOpen::SpreadsheetCellData* NXOpen::SpreadsheetManager::VerticalLookup | ( | const NXString & | file, |
const NXString & | target, | ||
const NXString & | range, | ||
int | offset, | ||
NXOpen::SpreadsheetManager::LookupMode | mode | ||
) |
Reads the value from a given spreadsheet using a vertical table lookup.
The Excel spreadsheet to be opened could be either from the native file system, or from the dataset file stored in the Teamcenter database.
Note: The mode works when the target cell contains only numeric values and the mode is ignored when the target cell contains text
file | File name with full path |
target | Lookup target |
range | Table range |
offset | The offset to the data cell. |
mode | The mode of lookup in the table. |
NXOpen::SpreadsheetCellData* NXOpen::SpreadsheetManager::VerticalLookup | ( | const char * | file, |
const char * | target, | ||
const char * | range, | ||
int | offset, | ||
NXOpen::SpreadsheetManager::LookupMode | mode | ||
) |
Reads the value from a given spreadsheet using a vertical table lookup.
The Excel spreadsheet to be opened could be either from the native file system, or from the dataset file stored in the Teamcenter database.
Note: The mode works when the target cell contains only numeric values and the mode is ignored when the target cell contains text
file | File name with full path |
target | Lookup target |
range | Table range |
offset | The offset to the data cell. |
mode | The mode of lookup in the table. |