GO2cam Javascript API
GO2SFeaturesRecognition Class Reference

Class to run the automatic features recognition and the machining of the features. More...

Inherits QObject.

Public Member Functions

 GO2SFeaturesRecognition ()
 Default constructor.
 
Number GetNbFeatures () noexcept
 
String GetResultsLog ()
 
GO2SEnum::GO2SError Launch (String settingsFile)
 
void SetPart (GO2SSolidGeometry solid)
 Set the solid to analyze.
 

Detailed Description

Class to run the automatic features recognition and the machining of the features.

var solids = GO2SGeometryUtil.GetByName('my_part')
var reco = new GO2SFeaturesRecognition()
reco.SetPart(solids[0])
var err = reco.Launch('c:/my_folder/my_config.inifeat')
console.log(reco.GetResultsLog())
if (err == GO2SError.success)
console.log(reco.GetNbFeatures() + ' feature(s) machined')
GO2SEnum::GO2SError Launch(String settingsFile)
void SetPart(GO2SSolidGeometry solid)
Set the solid to analyze.
Number GetNbFeatures() noexcept
GO2SFeaturesRecognition()
Default constructor.
String GetResultsLog()
Definition GO2SFeaturesRecognition.hpp:58
Class for utilitary methods of geometric entities.
Definition GO2SGeometryUtil.hpp:16
static void SetUsedPlane(Number newPlane=-1)
Definition GO2SGeometryUtil.hpp:189
static Array< GO2SGeometry > GetByName(String p1)
Warning
this class needs the GMF (General Manufacturing Features) module activated on your licence
Version
2027

Member Function Documentation

◆ GetNbFeatures()

Number GO2SFeaturesRecognition::GetNbFeatures ( )
noexcept
Returns
the number of features recognized by the last Launch() call

◆ GetResultsLog()

String GO2SFeaturesRecognition::GetResultsLog ( )
inline

Get what happened during the last Launch() call: the number of recognized features, and the reason why the recognition or the machining could not be completed.

Returns
the report of the last Launch() call, one message per line

◆ Launch()

GO2SEnum::GO2SError GO2SFeaturesRecognition::Launch ( String settingsFile)

Recognize the features of the part and machine them.

The settings file drives the whole recognition: only the typologies listed in it are recognized, each with the opelist linked.
Such a file can be produced by the "Save configuration" button of the features auto recognition dialog box, and uses the .inifeat extension. Once the features are created and their opelists affected, the machining operations are executed.

Remarks
SetPart() must be called first, and a stock must exist in the project. The recognition runs in the plane set by GO2SGeometryUtil.SetUsedPlane() or otherwise in the current working plane.
Returns
GO2SError.success (0) if at least one machining process has been created, GO2SError.bad_parameters if the settings file is not found or incorrect, GO2SError.exec_failed if no feature or no machining could be computed
Parameters
[in]settingsFileabsolute path of the settings file

◆ SetPart()

void GO2SFeaturesRecognition::SetPart ( GO2SSolidGeometry solid)

Set the solid to analyze.

Parameters
[in]solidthe solid to analyze