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

Represents a class for internal spreadsheet. More...

Inheritance diagram for NXOpen::Spreadsheet:
NXOpen::TransientObject

Public Member Functions

void Clear ()
 Clears the contents of the current worksheet. More...
 
void Delete (int start1, int end1, int sheet, int operation)
 Deletes (clears) one or more rows/columns of data from a worksheet. More...
 
void DeleteSheets (int sheet, int count)
 Deletes specified number of sheets beginning with the specified sheet (from the current worksheet, if no sheet is specified). More...
 
void EraseRange (int row0, int col0, int row1, int col1, int sheet0, int sheet1)
 Clears the contents of the specified range
Created in NX11.0.0. More...
 
NXOpen::SpreadsheetCellDataEvaluateCell (int row, int col, int sheet)
 Returns the evaluated value of a cell. More...
 
NXOpen::SpreadsheetCellDataGetFormula (int row, int col, int sheet)
 Retrieves a formula from a cell. More...
 
void GetNamedRange (const NXString &rangename, std::vector< int > &namedrange)
 Resolves the named reference and returns the range of cells that are named This method returns a list, of the following format: Start Row, Start Column, End Row, End Column, Start Sheet Number, End Sheet Number of the named reference. More...
 
void GetNamedRange (const char *rangename, std::vector< int > &namedrange)
 Resolves the named reference and returns the range of cells that are named This method returns a list, of the following format: Start Row, Start Column, End Row, End Column, Start Sheet Number, End Sheet Number of the named reference. More...
 
NXOpen::SpreadsheetCellDataGetNumber (int row, int col, int sheet)
 Retrieves a numeric value from a cell. More...
 
int GetNumberOfSheets ()
 Returns the total number of sheets in the spreadsheet. More...
 
void GetSheetNames (std::vector< NXString > &sheetnames)
 Returns list of existing sheet names in the spreadsheet. More...
 
int GetSheetNumber ()
 Returns the current work sheet number of the spreadsheet. More...
 
int GetSheetNumberOfName (const NXString &sheetname)
 Returns sheet number of the sheet with given name. More...
 
int GetSheetNumberOfName (const char *sheetname)
 Returns sheet number of the sheet with given name. More...
 
NXOpen::SpreadsheetCellDataGetString (int row, int col, int sheet)
 Returns the String in the cell. More...
 
NXOpen::SpreadsheetCellDataGetValue (int row, int col, int sheet)
 Returns a number, string or formula depending on the contents of the cell. More...
 
void InsertSheets (int sheet, int count)
 Inserts specified number of sheets before the specified sheet (or the current work sheet if no sheet is specified). More...
 
void Recalculate ()
 Recalculates the spreadsheet. More...
 
void Save ()
 Saves the spreadsheet in the part file. More...
 
void SetFormula (int row, int col, NXOpen::SpreadsheetCellData *cellvalue, int sheet)
 Stores a formula into a cell. More...
 
void SetNamedRange (const NXString &rangename, int row0, int col0, int row1, int col1, int sheet)
 Defines a name for the Range of cells. More...
 
void SetNamedRange (const char *rangename, int row0, int col0, int row1, int col1, int sheet)
 Defines a name for the Range of cells. More...
 
void SetNumber (int row, int col, NXOpen::SpreadsheetCellData *cellvalue, int sheet)
 Stores a numeric value in the specified cell of the worksheet. More...
 
void SetSheetNumber (int sheet)
 Sets the worksheet with specified index as current worksheet
Created in NX11.0.0. More...
 
void SetString (int row, int col, NXOpen::SpreadsheetCellData *cellvalue, int sheet)
 Sets the string in the cell. More...
 
void Terminate ()
 Terminates excel sheet for opened part. More...
 
virtual ~Spreadsheet ()
 Free resources associated with the instance. More...
 
- Public Member Functions inherited from NXOpen::TransientObject
void * GetHandle ()
 Handle of the internal object represented by this object. More...
 

Detailed Description

Represents a class for internal spreadsheet.

To call functions from this class, use Spreadsheet object returned by NXOpen::SpreadsheetManager::Open .
Usable only on Windows

Created in NX11.0.0.

Constructor & Destructor Documentation

virtual NXOpen::Spreadsheet::~Spreadsheet ( )
virtual

Free resources associated with the instance.

After this method is called, it is illegal to use the object. In .NET, this method is automatically called when the object is deleted by the garbage collector.
Created in NX11.0.0.

License requirements : None

Member Function Documentation

void NXOpen::Spreadsheet::Clear ( )

Clears the contents of the current worksheet.


Created in NX11.0.0.

License requirements : None

void NXOpen::Spreadsheet::Delete ( int  start1,
int  end1,
int  sheet,
int  operation 
)

Deletes (clears) one or more rows/columns of data from a worksheet.


Created in NX11.0.0.

License requirements : None

Parameters
start1From where the deletion should start
end1Upto where the rows should be deleted
sheetThe sheet in which deletion should take place.(Current sheet, if no sheet is specified)
operation1 for row deletion and 2 for column deletion.
void NXOpen::Spreadsheet::DeleteSheets ( int  sheet,
int  count 
)

Deletes specified number of sheets beginning with the specified sheet (from the current worksheet, if no sheet is specified).


Created in NX11.0.0.

License requirements : None

Parameters
sheetSheet Number, starting from which sheets are to be deleted.
countNumber of sheets to be deleted
void NXOpen::Spreadsheet::EraseRange ( int  row0,
int  col0,
int  row1,
int  col1,
int  sheet0,
int  sheet1 
)

Clears the contents of the specified range
Created in NX11.0.0.



License requirements : None

Parameters
row0Starting row for range
col0Starting column for range
row1Ending row for range
col1Ending column for range
sheet0Sheet number for start of the range
sheet1Sheet number for end of the range
NXOpen::SpreadsheetCellData* NXOpen::Spreadsheet::EvaluateCell ( int  row,
int  col,
int  sheet 
)

Returns the evaluated value of a cell.

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

License requirements : None
Parameters
rowRow index of the cell
colColumn index of the cell
sheetSheet index (current worksheet, if zero is specified).
NXOpen::SpreadsheetCellData* NXOpen::Spreadsheet::GetFormula ( int  row,
int  col,
int  sheet 
)

Retrieves a formula from a cell.

Returns
Retrieves a formula from a cell.
Created in NX11.0.0.

License requirements : None
Parameters
rowRow index of the cell
colColumn index of the cell
sheetSheet index (current worksheet, if zero is specified)
void NXOpen::Spreadsheet::GetNamedRange ( const NXString rangename,
std::vector< int > &  namedrange 
)

Resolves the named reference and returns the range of cells that are named This method returns a list, of the following format: Start Row, Start Column, End Row, End Column, Start Sheet Number, End Sheet Number of the named reference.


Created in NX11.0.0.

License requirements : None

Parameters
rangenameRange name
namedrangeThe range of cells for given range name
void NXOpen::Spreadsheet::GetNamedRange ( const char *  rangename,
std::vector< int > &  namedrange 
)

Resolves the named reference and returns the range of cells that are named This method returns a list, of the following format: Start Row, Start Column, End Row, End Column, Start Sheet Number, End Sheet Number of the named reference.


Created in NX11.0.0.

License requirements : None

Parameters
rangenameRange name
namedrangeThe range of cells for given range name
NXOpen::SpreadsheetCellData* NXOpen::Spreadsheet::GetNumber ( int  row,
int  col,
int  sheet 
)

Retrieves a numeric value from a cell.

Returns
Retrieves a numerical value from a cell
Created in NX11.0.0.

License requirements : None
Parameters
rowRow index of the cell
colColumn index of the cell
sheetSheet index (current worksheet, if zero is specified)
int NXOpen::Spreadsheet::GetNumberOfSheets ( )

Returns the total number of sheets in the spreadsheet.

Returns
Number of sheets in the spreadsheet
Created in NX11.0.0.

License requirements : None
void NXOpen::Spreadsheet::GetSheetNames ( std::vector< NXString > &  sheetnames)

Returns list of existing sheet names in the spreadsheet.


Created in NX11.0.0.

License requirements : None

Parameters
sheetnamesList of sheet names from specified spreadsheet
int NXOpen::Spreadsheet::GetSheetNumber ( )

Returns the current work sheet number of the spreadsheet.

Returns
Current work sheet number of the spreadsheet.
Created in NX11.0.0.

License requirements : None
int NXOpen::Spreadsheet::GetSheetNumberOfName ( const NXString sheetname)

Returns sheet number of the sheet with given name.

Returns
Work sheet number of the given spreadsheet name.
Created in NX11.0.0.

License requirements : None
Parameters
sheetnameSheet name
int NXOpen::Spreadsheet::GetSheetNumberOfName ( const char *  sheetname)

Returns sheet number of the sheet with given name.

Returns
Work sheet number of the given spreadsheet name.
Created in NX11.0.0.

License requirements : None
Parameters
sheetnameSheet name
NXOpen::SpreadsheetCellData* NXOpen::Spreadsheet::GetString ( int  row,
int  col,
int  sheet 
)

Returns the String in the cell.

Returns
Retrieves a string value from a cell
Created in NX11.0.0.

License requirements : None
Parameters
rowRow index of the cell
colColumn index of the cell
sheetSheet index of the cell (current worksheet, if zero is specified).
NXOpen::SpreadsheetCellData* NXOpen::Spreadsheet::GetValue ( int  row,
int  col,
int  sheet 
)

Returns a number, string or formula depending on the contents of the cell.

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

License requirements : None
Parameters
rowRow index of the cell
colColumn index of the cell
sheetSheet index of the cell (current worksheet, if zero is specified).
void NXOpen::Spreadsheet::InsertSheets ( int  sheet,
int  count 
)

Inserts specified number of sheets before the specified sheet (or the current work sheet if no sheet is specified).


Created in NX11.0.0.

License requirements : None

Parameters
sheetSheet number, before which the sheets are to be inserted.
countNumber of sheets to be inserted.
void NXOpen::Spreadsheet::Recalculate ( )

Recalculates the spreadsheet.


Created in NX11.0.0.

License requirements : None

void NXOpen::Spreadsheet::Save ( )

Saves the spreadsheet in the part file.


Created in NX11.0.0.

License requirements : None

void NXOpen::Spreadsheet::SetFormula ( int  row,
int  col,
NXOpen::SpreadsheetCellData cellvalue,
int  sheet 
)

Stores a formula into a cell.


Created in NX11.0.0.

License requirements : None

Parameters
rowRow index of the cell
colColumn index of the cell
cellvaluecellvalue
sheetSheet index of the cell (current worksheet, if zero is specified).
void NXOpen::Spreadsheet::SetNamedRange ( const NXString rangename,
int  row0,
int  col0,
int  row1,
int  col1,
int  sheet 
)

Defines a name for the Range of cells.


Created in NX11.0.0.

License requirements : None

Parameters
rangenameName to be given to the range
row0Starting row of the table, which is being named
col0Starting column of the table, which is being named
row1Row of the table, upto which the name will apply
col1Column of the table, upto which the name will apply
sheetSheet index of the table (current worksheet, if zero is specified).
void NXOpen::Spreadsheet::SetNamedRange ( const char *  rangename,
int  row0,
int  col0,
int  row1,
int  col1,
int  sheet 
)

Defines a name for the Range of cells.


Created in NX11.0.0.

License requirements : None

Parameters
rangenameName to be given to the range
row0Starting row of the table, which is being named
col0Starting column of the table, which is being named
row1Row of the table, upto which the name will apply
col1Column of the table, upto which the name will apply
sheetSheet index of the table (current worksheet, if zero is specified).
void NXOpen::Spreadsheet::SetNumber ( int  row,
int  col,
NXOpen::SpreadsheetCellData cellvalue,
int  sheet 
)

Stores a numeric value in the specified cell of the worksheet.


Created in NX11.0.0.

License requirements : None

Parameters
rowRow index of the cell
colColumn index of the cell
cellvalueNumeric value to be set in the cell.
sheetSheet index (current worksheet, if zero is specified).
void NXOpen::Spreadsheet::SetSheetNumber ( int  sheet)

Sets the worksheet with specified index as current worksheet
Created in NX11.0.0.



License requirements : None

Parameters
sheetThe number to which the current work sheet is to be set.
void NXOpen::Spreadsheet::SetString ( int  row,
int  col,
NXOpen::SpreadsheetCellData cellvalue,
int  sheet 
)

Sets the string in the cell.


Created in NX11.0.0.

License requirements : None

Parameters
rowRow index of the cell.
colColumn index of the cell.
cellvalueString to be stored in this cell.
sheetSheet index (current worksheet, if zero is specified).
void NXOpen::Spreadsheet::Terminate ( )

Terminates excel sheet for opened part.


Created in NX11.0.0.

License requirements : None


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