Skip to main content
2-Explorer
January 13, 2021
Question

Flange Predefined Section name Using Toolkit

  • January 13, 2021
  • 2 replies
  • 1472 views

Hi

 

We want to know which section is used in Flange (I, Arc, S , Open Etc...) using toolkit... Could not find any direct API for same. So , thought of using element tree. Is there any element which stores this predefined shape name for flange feature element tree? 

 

Created a flange feature with I section, extracted element tree in XML. Modified flange as S section and extracted again element tree... Both the XML files are same so getting confused on how to identify which element is storing this information. If no element is there for this, is there any possibility to decide on this information?

2 replies

FV_01
January 14, 2021

the question boils down to 2D polygon matching, scale/rotation/mirror invariant.

google 'shape matching algorithm c++ python'.

take a look at Boost.Polygon library and OpenCV library. 

HIH.

 

14-Alexandrite
July 20, 2026

I could not find a PTC API for getting a bend feature’s shape (C, Z, …) for PRO_FEAT_WALL features, but the shape information is printed in the output of the Creo Parametric functionality: Information → Feature Information, in the feature.inf.
This text can be requested via TOOLKIT API and stored as a file (with a custom name) as follows:
 

    _swprintf(wsTmpInfoFileName, PDS_PROG_NAMEW L"_PRO_FEAT_INFO_feat_id_%d.txt", pFeat->pFeat.id);
pErr = ProOutputFileMdlnameWrite(pFeat->pFeat.owner, wsTmpInfoFileName, PRO_FEAT_INFO, NULL, (ProAppData) &pFeat->pFeat.id, NULL, NULL);

//...

// Scan result file, line by line, search for relevant token (attention: some strings in this feature.inf output are Creo language specific, so we better exclude them from our search, where possible.)

if ( strstr(cLine, " = C_HEM ") != NULL ) {
pFeat->enmBendType = PDS_OBP_BendType_C; // Found PRO_FEAT_WALL feature with Shape C_HEM.
} else if ( strstr(cLine, " = Z_HEM ") != NULL ) {
pFeat->enmBendType = PDS_OBP_BendType_Z; // Found PRO_FEAT_WALL feature with Shape Z_HEM.
} // ...

This works in first tests so far.