NX Open C++ Reference Guide
Public Types | Public Member Functions | List of all members
NXOpen::SpreadsheetManager Class Reference

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::SpreadsheetCellDataCreateCellData ()
 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::SpreadsheetCellDataHorizontalLookup (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::SpreadsheetCellDataHorizontalLookup (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::SpreadsheetOpen (NXOpen::SpreadsheetManager::Sheettype sheettype, const NXString &partfile)
 Opens excel sheet associated with given part file. More...
 
NXOpen::SpreadsheetOpen (NXOpen::SpreadsheetManager::Sheettype sheettype, const char *partfile)
 Opens excel sheet associated with given part file. More...
 
NXOpen::SpreadsheetExternalOpenFile (const NXString &sheet, NXOpen::SpreadsheetManager::OpenMode mode)
 Opens an Excel spreadsheet file. More...
 
NXOpen::SpreadsheetExternalOpenFile (const char *sheet, NXOpen::SpreadsheetManager::OpenMode mode)
 Opens an Excel spreadsheet file. More...
 
NXOpen::SpreadsheetCellDataReadAny (const NXString &filename, const NXString &cell)
 Reads value in a given cell, from a given spreadsheet. More...
 
NXOpen::SpreadsheetCellDataReadAny (const char *filename, const char *cell)
 Reads value in a given cell, from a given spreadsheet. More...
 
NXOpen::SpreadsheetCellDataReadCell (const NXString &filename, const NXString &cell)
 Reads value in a given cell, from a given spreadsheet. More...
 
NXOpen::SpreadsheetCellDataReadCell (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::SpreadsheetCellDataVerticalLookup (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::SpreadsheetCellDataVerticalLookup (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...
 

Detailed Description

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.

Member Enumeration Documentation

Modes of lookup in the table.


Created in NX11.0.0.

Enumerator
LookupModeExact 

Requires an exact match.

LookupModeHigher 

Returns the higher cell.

LookupModeLower 

Returns the lower cell.

LookupModeClosest 

Returns the closest cell.

Sheet types to open spreadsheet.


Created in NX11.0.0.

Enumerator
OpenModeRead 

read mode

OpenModeWrite 

write mode

Sheet types to open spreadsheet.


Created in NX11.0.0.

Enumerator
SheettypeGateway 

Specifies Gateway sheet type.

SheettypeModeling 

Specifies Modeling sheet type.

SheettypePartfamily 

specifies Partfamily sheet type

Member Function Documentation

NXOpen::SpreadsheetCellData* NXOpen::SpreadsheetManager::CreateCellData ( )

Creates SpreadsheetCellData object.

Returns
SpreadsheetCellData object.
Created in NX11.0.0.

License requirements : None
NXString NXOpen::SpreadsheetManager::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.

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.

Returns
If the file is exported successfully, the function returns a string indicating the full file name in native file system. If the file failed to export, the function returns empty string indicating no native file available.

In Native mode, it does nothing and always returns an empty string.
Created in NX11.0.0.

License requirements : None

Parameters
partnumA 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.

Returns
If the file is exported successfully, the function returns a string indicating the full file name in native file system. If the file failed to export, the function returns empty string indicating no native file available.

In Native mode, it does nothing and always returns an empty string.
Created in NX11.0.0.

License requirements : None

Parameters
partnumA 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

Returns
The calculated value in a spreadsheet cell as per the horizontal lookup
Created in NX11.0.0.

License requirements : None
Parameters
fileFile name with full path
targetLookup target
rangeTable range
offsetThe offset to the data cell.
modeThe 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

Returns
The calculated value in a spreadsheet cell as per the horizontal lookup
Created in NX11.0.0.

License requirements : None
Parameters
fileFile name with full path
targetLookup target
rangeTable range
offsetThe offset to the data cell.
modeThe 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.

Returns
Returns a Spreadsheet object to be used to access the spreadsheet.
Created in NX11.0.0.

License requirements : None
Parameters
sheettypeSheet type
partfilePart 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.

Returns
Returns a Spreadsheet object to be used to access the spreadsheet.
Created in NX11.0.0.

License requirements : None
Parameters
sheettypeSheet type
partfilePart 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.

Returns
Returns a SpreadsheetExternal object to be used to access the external spreadsheet.
Created in NX11.0.0.

License requirements : None
Parameters
sheetAn external Excel file name
modeMode 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.

Returns
Returns a SpreadsheetExternal object to be used to access the external spreadsheet.
Created in NX11.0.0.

License requirements : None
Parameters
sheetAn external Excel file name
modeMode 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.

Returns
The value in a spreadsheet cell as either a string or a number
Created in NX11.0.0.

License requirements : None
Parameters
filenameFile name with full path
cellCell 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.

Returns
The value in a spreadsheet cell as either a string or a number
Created in NX11.0.0.

License requirements : None
Parameters
filenameFile name with full path
cellCell 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.

Returns
The numerical value in a spreadsheet cell.
Created in NX11.0.0.

License requirements : None
Parameters
filenameFile name with full path
cellCell 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.

Returns
The numerical value in a spreadsheet cell.
Created in NX11.0.0.

License requirements : None
Parameters
filenameFile name with full path
cellCell 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

Returns
The calculated value in a spreadsheet cell as per the vertical lookup
Created in NX11.0.0.

License requirements : None
Parameters
fileFile name with full path
targetLookup target
rangeTable range
offsetThe offset to the data cell.
modeThe 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

Returns
The calculated value in a spreadsheet cell as per the vertical lookup
Created in NX11.0.0.

License requirements : None
Parameters
fileFile name with full path
targetLookup target
rangeTable range
offsetThe offset to the data cell.
modeThe mode of lookup in the table.

The documentation for this class was generated from the following file:
Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.