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

This class provides the methods to execute shape search and get the searched results. More...

Inheritance diagram for NXOpen::ShapeSearch::ShapeSearchBuilder:
NXOpen::Builder NXOpen::TaggedObject NXOpen::GeometricUtilities::IComponentBuilder

Public Types

enum  OpenPartType { OpenPartTypeNotSetDisplayPart, OpenPartTypeSetDisplayPartOnlyWhenOpen, OpenPartTypeAlwaysSetDisplayPart }
 The open part type enum. More...
 
enum  SearchByType { SearchByTypeAttribute, SearchByTypeBody, SearchByTypePart }
 The search type enum. More...
 
enum  ShapeSimilarity { ShapeSimilarityIdentical, ShapeSimilarityVerySimilar, ShapeSimilaritySimilar }
 The search shape similarity enum. More...
 
enum  ShapeSize {
  ShapeSizeP90P110, ShapeSizeP80P120, ShapeSizeP70P130, ShapeSizeP50P200,
  ShapeSizeP25P400
}
 The search shape size enum. More...
 

Public Member Functions

int CustomShapeSizeLowerLimit ()
 Returns the custom shape size lower limit to be set for search. More...
 
int CustomShapeSizeUpperLimit ()
 Returns the custom shape size upper limit to be set for search. More...
 
void ExecuteSearch (bool isNew, const NXString &searchName, int *nTotalResults, NXString *errorMessage)
 Execute new search or saved search and output error message if error. More...
 
void ExecuteSearch (bool isNew, const char *searchName, int *nTotalResults, NXString *errorMessage)
 Execute new search or saved search and output error message if error. More...
 
std::vector< NXStringGetInputAttributesFilter ()
 The input attributes filter to be searched. More...
 
std::vector< NXStringGetInputAttributesName ()
 The input attributes name to be searched. More...
 
void GetResults (const NXString &searchName, int startResultId, int endResultId)
 Get specified search results from database. More...
 
void GetResults (const char *searchName, int startResultId, int endResultId)
 Get specified search results from database. More...
 
NXOpen::SelectNXObjectListInputBody ()
 Returns the input body to be searched
Created in NX6.0.0. More...
 
NXString InputPart ()
 Returns the input part to be searched
Created in NX6.0.0. More...
 
void OpenResultPart (NXOpen::ShapeSearch::ShapeSearchBuilder::OpenPartType openPartType, const NXString &searchName, int resultId)
 Open the searched result part. More...
 
void OpenResultPart (NXOpen::ShapeSearch::ShapeSearchBuilder::OpenPartType openPartType, const char *searchName, int resultId)
 Open the searched result part. More...
 
NXString ReferenceSetName ()
 Returns the part reference set name to be set for search
Created in NX6.0.0. More...
 
NXOpen::ShapeSearch::ShapeSearchBuilder::ShapeSimilarity SearchShapeSimilarity ()
 Returns the shape similarity to be set for search
Created in NX6.0.0. More...
 
NXOpen::ShapeSearch::ShapeSearchBuilder::ShapeSize SearchShapeSize ()
 Returns the shape size to be set for search. More...
 
NXOpen::ShapeSearch::ShapeSearchBuilder::SearchByType SearchType ()
 Returns the search type
Created in NX6.0.0. More...
 
void SetCustomShapeSizeLowerLimit (int customShapeSizeLowerLimit)
 Sets the custom shape size lower limit to be set for search. More...
 
void SetCustomShapeSizeUpperLimit (int customShapeSizeUpperLimit)
 Sets the custom shape size upper limit to be set for search. More...
 
void SetInputAttributesFilter (std::vector< NXString > &inputAttributesFilter)
 The input attributes filter to be searched
Created in NX6.0.0. More...
 
void SetInputAttributesName (std::vector< NXString > &inputAttributesName)
 The input attributes name to be searched
Created in NX6.0.0. More...
 
void SetInputPart (const NXString &inputPart)
 Sets the input part to be searched
Created in NX6.0.0. More...
 
void SetInputPart (const char *inputPart)
 Sets the input part to be searched
Created in NX6.0.0. More...
 
void SetReferenceSetName (const NXString &referenceSetName)
 Sets the part reference set name to be set for search
Created in NX6.0.0. More...
 
void SetReferenceSetName (const char *referenceSetName)
 Sets the part reference set name to be set for search
Created in NX6.0.0. More...
 
void SetSearchShapeSimilarity (NXOpen::ShapeSearch::ShapeSearchBuilder::ShapeSimilarity searchShapeSimilarity)
 Sets the shape similarity to be set for search
Created in NX6.0.0. More...
 
void SetSearchShapeSize (NXOpen::ShapeSearch::ShapeSearchBuilder::ShapeSize searchShapeSize)
 Sets the shape size to be set for search. More...
 
void SetSearchType (NXOpen::ShapeSearch::ShapeSearchBuilder::SearchByType searchType)
 Sets the search type
Created in NX6.0.0. More...
 
void SetUseCustomShapeSize (bool useCustomShapeSize)
 Sets the use custom shape size to control use shape size option or custom shape size
Created in NX6.0.0. More...
 
bool UseCustomShapeSize ()
 Returns the use custom shape size to control use shape size option or custom shape size
Created in NX6.0.0. More...
 
- Public Member Functions inherited from NXOpen::Builder
NXOpen::NXObjectCommit ()
 Commits any edits that have been applied to the builder. More...
 
void Destroy ()
 Deletes the builder, and cleans up any objects created by the builder. More...
 
std::vector< NXOpen::NXObject * > GetCommittedObjects ()
 For builders that create more than one object, this method returns the objects that are created by commit. More...
 
NXOpen::NXObjectGetObject ()
 Returns the object currently being edited by this builder. More...
 
void ShowResults ()
 Updates the model to reflect the result of an edit to the model for all builders that support showing results. More...
 
virtual bool Validate ()
 Validate whether the inputs to the component are sufficient for commit to be called. More...
 
- Public Member Functions inherited from NXOpen::TaggedObject
tag_t Tag () const
 Returns the tag of this object. More...
 

Detailed Description

This class provides the methods to execute shape search and get the searched results.

The operation that this builder supports has three types: (set by ShapeSearch::ShapeSearchBuilder::SetSearchType )

  1. Search by attributes.

  2. Search by body combined attributes with shape similarity and shape size condition. Support multiple bodies.

  3. Search by part combined attributes with shape similarity and shape size condition. Support loaded part, OS part, Teamcenter part and component.

When initialize builder, we will load all saved searches from work directory and add them to search list. You can implement ShapeSearch::ShapeSearchBuilder::ExecuteSearch to run the saved search.

After define the search criteria, function ShapeSearch::ShapeSearchBuilder::ExecuteSearch can search the shape from database and return the searched results count and error message if fails. The search is specified by 'searchName' parameter.

The method ShapeSearch::ShapeSearchBuilder::GetResults can get the specified results from database. The range of results is specified by the parameters 'startResultId' and 'endResultId', the search is specified by 'searchName' parameter.

The method ShapeSearch::ShapeSearchBuilder::OpenResultPart can open the selected result part of the specified search. The result is specified by 'resultId' parameter, the search is specified by 'searchName' parameter.


To create a new instance of this class, use NXOpen::ShapeSearch::SearchManager::CreateShapeSearchBuilder

Created in NX6.0.0.

Member Enumeration Documentation

The open part type enum.

Enumerator
OpenPartTypeNotSetDisplayPart 

Not set the opened part as display part.

OpenPartTypeSetDisplayPartOnlyWhenOpen 

Set the opened part as display part only when it doesn't exist in the session.

OpenPartTypeAlwaysSetDisplayPart 

Always set the opened part as display part whether it exists in the session.

The search type enum.

Enumerator
SearchByTypeAttribute 

search by attributes

SearchByTypeBody 

search by bodies

SearchByTypePart 

search by part

The search shape similarity enum.

Enumerator
ShapeSimilarityIdentical 

search with identical condition

ShapeSimilarityVerySimilar 

search with very similar condition

ShapeSimilaritySimilar 

search with similar condition

The search shape size enum.

Enumerator
ShapeSizeP90P110 

search with shape size 90%-110% condition

ShapeSizeP80P120 

search with shape size 80%-120% condition

ShapeSizeP70P130 

search with shape size 70%-130% condition

ShapeSizeP50P200 

search with shape size 50%-200% condition

ShapeSizeP25P400 

search with shape size 25%-400% condition

Member Function Documentation

int NXOpen::ShapeSearch::ShapeSearchBuilder::CustomShapeSizeLowerLimit ( )

Returns the custom shape size lower limit to be set for search.

It is used only when use custom shape size is true. It must be greater than zero and less than upper limit.
Created in NX6.0.0.

License requirements : shape_search ("Shape Search")

int NXOpen::ShapeSearch::ShapeSearchBuilder::CustomShapeSizeUpperLimit ( )

Returns the custom shape size upper limit to be set for search.

It is used only when use custom shape size is true. It must be greater than lower limit.
Created in NX6.0.0.

License requirements : shape_search ("Shape Search")

void NXOpen::ShapeSearch::ShapeSearchBuilder::ExecuteSearch ( bool  isNew,
const NXString searchName,
int *  nTotalResults,
NXString errorMessage 
)

Execute new search or saved search and output error message if error.


Created in NX6.0.0.

License requirements : shape_search ("Shape Search")

Parameters
isNewTrue is executing new search, False is executing saved search
searchNameSearch name
nTotalResultsSearch result total number
errorMessageSearch error message
void NXOpen::ShapeSearch::ShapeSearchBuilder::ExecuteSearch ( bool  isNew,
const char *  searchName,
int *  nTotalResults,
NXString errorMessage 
)

Execute new search or saved search and output error message if error.


Created in NX6.0.0.

License requirements : shape_search ("Shape Search")

Parameters
isNewTrue is executing new search, False is executing saved search
searchNameSearch name
nTotalResultsSearch result total number
errorMessageSearch error message
std::vector<NXString> NXOpen::ShapeSearch::ShapeSearchBuilder::GetInputAttributesFilter ( )

The input attributes filter to be searched.

Returns

Created in NX6.0.0.

License requirements : shape_search ("Shape Search")
std::vector<NXString> NXOpen::ShapeSearch::ShapeSearchBuilder::GetInputAttributesName ( )

The input attributes name to be searched.

Returns

Created in NX6.0.0.

License requirements : shape_search ("Shape Search")
void NXOpen::ShapeSearch::ShapeSearchBuilder::GetResults ( const NXString searchName,
int  startResultId,
int  endResultId 
)

Get specified search results from database.


Created in NX6.0.0.

License requirements : shape_search ("Shape Search")

Parameters
searchNameSearch name
startResultIdStart result id
endResultIdEnd result id
void NXOpen::ShapeSearch::ShapeSearchBuilder::GetResults ( const char *  searchName,
int  startResultId,
int  endResultId 
)

Get specified search results from database.


Created in NX6.0.0.

License requirements : shape_search ("Shape Search")

Parameters
searchNameSearch name
startResultIdStart result id
endResultIdEnd result id
NXOpen::SelectNXObjectList* NXOpen::ShapeSearch::ShapeSearchBuilder::InputBody ( )

Returns the input body to be searched
Created in NX6.0.0.



License requirements : shape_search ("Shape Search")

NXString NXOpen::ShapeSearch::ShapeSearchBuilder::InputPart ( )

Returns the input part to be searched
Created in NX6.0.0.



License requirements : shape_search ("Shape Search")

void NXOpen::ShapeSearch::ShapeSearchBuilder::OpenResultPart ( NXOpen::ShapeSearch::ShapeSearchBuilder::OpenPartType  openPartType,
const NXString searchName,
int  resultId 
)

Open the searched result part.


Created in NX6.0.0.

License requirements : shape_search ("Shape Search")

Parameters
openPartTypeOpen part type
searchNameSearch name
resultIdResult id
void NXOpen::ShapeSearch::ShapeSearchBuilder::OpenResultPart ( NXOpen::ShapeSearch::ShapeSearchBuilder::OpenPartType  openPartType,
const char *  searchName,
int  resultId 
)

Open the searched result part.


Created in NX6.0.0.

License requirements : shape_search ("Shape Search")

Parameters
openPartTypeOpen part type
searchNameSearch name
resultIdResult id
NXString NXOpen::ShapeSearch::ShapeSearchBuilder::ReferenceSetName ( )

Returns the part reference set name to be set for search
Created in NX6.0.0.



License requirements : shape_search ("Shape Search")

NXOpen::ShapeSearch::ShapeSearchBuilder::ShapeSimilarity NXOpen::ShapeSearch::ShapeSearchBuilder::SearchShapeSimilarity ( )

Returns the shape similarity to be set for search
Created in NX6.0.0.



License requirements : shape_search ("Shape Search")

NXOpen::ShapeSearch::ShapeSearchBuilder::ShapeSize NXOpen::ShapeSearch::ShapeSearchBuilder::SearchShapeSize ( )

Returns the shape size to be set for search.

It is used only when use custom shape size is false.
Created in NX6.0.0.

License requirements : shape_search ("Shape Search")

NXOpen::ShapeSearch::ShapeSearchBuilder::SearchByType NXOpen::ShapeSearch::ShapeSearchBuilder::SearchType ( )

Returns the search type
Created in NX6.0.0.



License requirements : shape_search ("Shape Search")

void NXOpen::ShapeSearch::ShapeSearchBuilder::SetCustomShapeSizeLowerLimit ( int  customShapeSizeLowerLimit)

Sets the custom shape size lower limit to be set for search.

It is used only when use custom shape size is true. It must be greater than zero and less than upper limit.
Created in NX6.0.0.

License requirements : shape_search ("Shape Search")

Parameters
customShapeSizeLowerLimitcustomshapesizelowerlimit
void NXOpen::ShapeSearch::ShapeSearchBuilder::SetCustomShapeSizeUpperLimit ( int  customShapeSizeUpperLimit)

Sets the custom shape size upper limit to be set for search.

It is used only when use custom shape size is true. It must be greater than lower limit.
Created in NX6.0.0.

License requirements : shape_search ("Shape Search")

Parameters
customShapeSizeUpperLimitcustomshapesizeupperlimit
void NXOpen::ShapeSearch::ShapeSearchBuilder::SetInputAttributesFilter ( std::vector< NXString > &  inputAttributesFilter)

The input attributes filter to be searched
Created in NX6.0.0.



License requirements : shape_search ("Shape Search")

Parameters
inputAttributesFilterSearch attributes filter
void NXOpen::ShapeSearch::ShapeSearchBuilder::SetInputAttributesName ( std::vector< NXString > &  inputAttributesName)

The input attributes name to be searched
Created in NX6.0.0.



License requirements : shape_search ("Shape Search")

Parameters
inputAttributesNameSearch attributes Name
void NXOpen::ShapeSearch::ShapeSearchBuilder::SetInputPart ( const NXString inputPart)

Sets the input part to be searched
Created in NX6.0.0.



License requirements : shape_search ("Shape Search")

Parameters
inputPartinputpart
void NXOpen::ShapeSearch::ShapeSearchBuilder::SetInputPart ( const char *  inputPart)

Sets the input part to be searched
Created in NX6.0.0.



License requirements : shape_search ("Shape Search")

Parameters
inputPartinputpart
void NXOpen::ShapeSearch::ShapeSearchBuilder::SetReferenceSetName ( const NXString referenceSetName)

Sets the part reference set name to be set for search
Created in NX6.0.0.



License requirements : shape_search ("Shape Search")

Parameters
referenceSetNamereferencesetname
void NXOpen::ShapeSearch::ShapeSearchBuilder::SetReferenceSetName ( const char *  referenceSetName)

Sets the part reference set name to be set for search
Created in NX6.0.0.



License requirements : shape_search ("Shape Search")

Parameters
referenceSetNamereferencesetname
void NXOpen::ShapeSearch::ShapeSearchBuilder::SetSearchShapeSimilarity ( NXOpen::ShapeSearch::ShapeSearchBuilder::ShapeSimilarity  searchShapeSimilarity)

Sets the shape similarity to be set for search
Created in NX6.0.0.



License requirements : shape_search ("Shape Search")

Parameters
searchShapeSimilaritysearchshapesimilarity
void NXOpen::ShapeSearch::ShapeSearchBuilder::SetSearchShapeSize ( NXOpen::ShapeSearch::ShapeSearchBuilder::ShapeSize  searchShapeSize)

Sets the shape size to be set for search.

It is used only when use custom shape size is false.
Created in NX6.0.0.

License requirements : shape_search ("Shape Search")

Parameters
searchShapeSizesearchshapesize
void NXOpen::ShapeSearch::ShapeSearchBuilder::SetSearchType ( NXOpen::ShapeSearch::ShapeSearchBuilder::SearchByType  searchType)

Sets the search type
Created in NX6.0.0.



License requirements : shape_search ("Shape Search")

Parameters
searchTypesearchtype
void NXOpen::ShapeSearch::ShapeSearchBuilder::SetUseCustomShapeSize ( bool  useCustomShapeSize)

Sets the use custom shape size to control use shape size option or custom shape size
Created in NX6.0.0.



License requirements : shape_search ("Shape Search")

Parameters
useCustomShapeSizeusecustomshapesize
bool NXOpen::ShapeSearch::ShapeSearchBuilder::UseCustomShapeSize ( )

Returns the use custom shape size to control use shape size option or custom shape size
Created in NX6.0.0.



License requirements : shape_search ("Shape Search")


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