NXOpen .NET Reference  12.0.0
Public Types | Public Member Functions | Properties | List of all members
NXOpen.SpreadsheetManager Class Reference

Represents a class for interacting with spreadsheets. More...

Inheritance diagram for NXOpen.SpreadsheetManager:

Public Types

enum  OpenMode { Read, Write }
 Sheet types to open spreadsheet. More...
 
enum  LookupMode { Exact, Higher, Lower, Closest }
 Modes of lookup in the table. More...
 
enum  Sheettype { Gateway, Modeling, Partfamily }
 Sheet types to open spreadsheet. More...
 

Public Member Functions

unsafe NXOpen.SpreadsheetCellData ReadCell (string filename, string cell)
 Reads value in a given cell, from a given spreadsheet. More...
 
unsafe NXOpen.SpreadsheetCellData ReadAny (string filename, string cell)
 Reads value in a given cell, from a given spreadsheet. More...
 
unsafe NXOpen.SpreadsheetCellData HorizontalLookup (string file, string target, string range, int offset, NXOpen.SpreadsheetManager.LookupMode mode)
 Reads the value from a given spreadsheet using a horizontal table lookup. More...
 
unsafe NXOpen.SpreadsheetCellData VerticalLookup (string file, string target, string range, int offset, NXOpen.SpreadsheetManager.LookupMode mode)
 Reads the value from a given spreadsheet using a vertical table lookup. More...
 
unsafe NXOpen.SpreadsheetExternal OpenFile (string sheet, NXOpen.SpreadsheetManager.OpenMode mode)
 Opens an Excel spreadsheet file. More...
 
unsafe string ExportFile (string 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...
 
unsafe NXOpen.Spreadsheet Open (NXOpen.SpreadsheetManager.Sheettype sheettype, string partfile)
 Opens excel sheet associated with given part file. More...
 
unsafe NXOpen.SpreadsheetCellData CreateCellData ()
 Creates SpreadsheetCellData object. More...
 

Properties

Tag Tag [get]
 Returns the tag of this object. 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.

Enumerator
Exact 

Requires an exact match

Higher 

Returns the higher cell

Lower 

Returns the lower cell

Closest 

Returns the closest cell

Sheet types to open spreadsheet.

Enumerator
Read 

read mode

Write 

write mode

Sheet types to open spreadsheet.

Enumerator
Gateway 

Specifies Gateway sheet type

Modeling 

Specifies Modeling sheet type

Partfamily 

specifies Partfamily sheet type

Member Function Documentation

unsafe NXOpen.SpreadsheetCellData NXOpen.SpreadsheetManager.CreateCellData ( )

Creates SpreadsheetCellData object.

Created in NX11.0.0

License requirements: None.

Returns
SpreadsheetCellData object.
unsafe string NXOpen.SpreadsheetManager.ExportFile ( string  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.

Created in NX11.0.0

License requirements: None.

Parameters
partnumA part number containing a MsExcel dataset.
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.

unsafe NXOpen.SpreadsheetCellData NXOpen.SpreadsheetManager.HorizontalLookup ( string  file,
string  target,
string  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

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.
Returns
The calculated value in a spreadsheet cell as per the horizontal lookup
unsafe NXOpen.Spreadsheet NXOpen.SpreadsheetManager.Open ( NXOpen.SpreadsheetManager.Sheettype  sheettype,
string  partfile 
)

Opens excel sheet associated with given part file.

And returns a Spreadsheet object.

Created in NX11.0.0

License requirements: None.

Parameters
sheettypeSheet type
partfilePart file
Returns
Returns a Spreadsheet object to be used to access the spreadsheet.
unsafe NXOpen.SpreadsheetExternal NXOpen.SpreadsheetManager.OpenFile ( string  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.

Created in NX11.0.0

License requirements: None.

Parameters
sheetAn external Excel file name
modeMode read/write
Returns
Returns a SpreadsheetExternal object to be used to access the external spreadsheet.
unsafe NXOpen.SpreadsheetCellData NXOpen.SpreadsheetManager.ReadAny ( string  filename,
string  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.

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
Returns
The value in a spreadsheet cell as either a string or a number
unsafe NXOpen.SpreadsheetCellData NXOpen.SpreadsheetManager.ReadCell ( string  filename,
string  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.

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
Returns
The numerical value in a spreadsheet cell.
unsafe NXOpen.SpreadsheetCellData NXOpen.SpreadsheetManager.VerticalLookup ( string  file,
string  target,
string  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

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.
Returns
The calculated value in a spreadsheet cell as per the vertical lookup

Property Documentation

Tag NXOpen.SpreadsheetManager.Tag
get

Returns the tag of this object.


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