Skip to main content
Nov 7, 2024 10:25 PM UTC
Acknowledged

In toolkit, make ProSurfaceSameSrfsFind method get the other half of cylinders in wireframe mode.

Related products:Creo Parametric

1. Describe the Problem

When in wireframe mode, the two halves of cylinders are not considered to be the same surface by the ProSurfaceSameSrfsFind method due to the presence of dividing lines (see article 

CS112362).  This is unexpected to us as one would presume the entire cylinder is the "same surface" even if dividing lines are shown.


2. Are you using a workaround?
No.

3. What is the use case for your organization?
In our product, which integrates with Creo, cylinders can be used as features representing geometry on the model.

4. What impact does this problem currently have on your organization?
Only half of a cylinder being made into a feature is unexpected behavior for the users of our product.

3 replies

Community Manager
Nov 8, 2024 7:58 AM UTC
Status changed to: Clarification Needed

Thank you @AS_10964709 for publishing your idea. However, we need more information as specified in the form you saw in the submission process. You may simply add a comment to your idea. The more details and context you give to document your idea, the better. Think about ways to educate and convince other Community members to support your idea and present your case to the product management team for consideration.

Please let us know within the next two weeks.

Additionally, I invite you to check out this topic where PTC executives explain product managers' approach to customer ideas and input for product roadmaps.

 

Please see examples of well-documented ideas: 

https://community.ptc.com/t5/Creo-Parametric-Ideas/Make-Shrinkwrap-quality-more-scalable-to-data-size-complexity/idi-p/810192 

https://community.ptc.com/t5/Creo-Parametric-Ideas/Option-to-Import-STEP-file-as-Inseparable-Assembly-by-Default/idi-p/812924 

https://community.ptc.com/t5/Creo-Parametric-Ideas/Eztol-Rename-action-not-synchronous-in-Eztol/idi-p/828000 

https://community.ptc.com/t5/Creo-Parametric-Ideas/Always-enable-ability-to-Add-View-Label-in-a-drawing/idi-p/837630 

Feature parameters can be input and changed togeth... - PTC Community 

Nov 8, 2024 4:03 PM UTC

I am working with Creo 10.0.2, however the issue has been around for many versions.

 

This idea is based on my support case 17557767 (https://support.ptc.com/apps/case_logger_viewer/auth/ssl/case=17557767)

 

For more information on reproducing, you need to create an application that connects to Creo using the toolkit.  Within this application you need to read in the selected surface (or whatever other way you want to obtain a surface) and call the ProSurfaceSameSrfsFind on it.  Using a sheetmetal part where a cylinder hole is created in wireframe display mode, have the application you created read in the surface of half of this hole.  When ProSurfaceSameSrfsFind is called, it will not consider the other half of the cylinder hole to me a "same surface" despite the fact that it will for other cylinders/cylinder holes.

Here is a method you can use in an app to do what I described.  It gets the selected surface, and if it is a surface of a type that should have an other half, it gets that other half and selects it as well, but it does not work for wireframe cut cylindrical hole:

 

ProError getOtherHalf()
{
 // Get what's currently selected
 ProSelection* currentSelections;
 ProError ptc_err = ProSelbufferSelectionsGet( &currentSelections );
 if( ptc_err == PRO_TK_NO_ERROR )
 {
 // For our scenario, there should only be one thing selected
 int selectionSize = 0;
 ProArraySizeGet( (ProArray)currentSelections, &selectionSize );
 if( selectionSize == 1 )
 {
 // Get the model item and assembly component path
 ProModelitem selectedModelItem;
 ProSelectionModelitemGet( currentSelections[0], &selectedModelItem );
 ProAsmcomppath compPath;
 ProSelectionAsmcomppathGet( currentSelections[0], &compPath );

 // Get the surface that is selected
 ProSurface selectedSurface = nullptr;
 ptc_err = ProSurfaceInit( selectedModelItem.owner, selectedModelItem.id, &selectedSurface );
 if( ptc_err == PRO_TK_NO_ERROR )
 {
 // Check if the surface is of a type with an other half
 ProSrftype selectedSurfaceType;
 ProSurfaceTypeGet( selectedSurface, &selectedSurfaceType );
 if( selectedSurfaceType == PRO_SRF_CYL || selectedSurfaceType == PRO_SRF_CONE || selectedSurfaceType == PRO_SRF_TORUS || selectedSurfaceType == PRO_SRF_REV )
 {
 // Get all same surfaces; this should have the other half
 ProMdl ownerOfSelected = selectedModelItem.owner;
 ProSurface* sameSurfaces;
 int sameSurfacesCount;
 ProArrayAlloc( 0, sizeof( ProSurface ), 1, (ProArray*)&sameSurfaces );
 ptc_err = ProSurfaceSameSrfsFind( (ProSolid)ownerOfSelected, selectedSurface, &sameSurfaces, &sameSurfacesCount ); // This is what isn't working.

 // Select all same surfaces (AKA, select the other half)
 for( int i = 0; i < sameSurfacesCount && ptc_err == PRO_TK_NO_ERROR; ++i )
 {
 ProSurface sameSurface = sameSurfaces[i];
 if( sameSurface != selectedSurface )
 {
 ProModelitem sameSurfaceModelItem;
 ptc_err = ProSurfaceToGeomitem( ProMdlToSolid( ownerOfSelected ), sameSurface, &sameSurfaceModelItem );
 if( ptc_err == PRO_TK_NO_ERROR )
 {
 ProSelection newSelection = nullptr;
 ptc_err = ProSelectionAlloc( &compPath, &sameSurfaceModelItem, &newSelection );
 if( ptc_err == PRO_TK_NO_ERROR )
 {
 ptc_err = ProSelbufferSelectionAdd( newSelection );
 ProSelectionFree( &newSelection );
 }
 }
 }
 }
 }
 }
 }
 }
 return ptc_err;
}

 

 

I'm not sure what more detail I can provide, though if there is a way to add attachments I can provide the full sample app I made where that code is from.

Community Manager
Nov 11, 2024 3:02 PM UTC
Status changed to: Acknowledged

Thank you @AS_10964709 for your idea. Based on the information you provided, we are acknowledging it as the Community management team. This is not a commitment from the Product team. Other users may comment and vote your idea up.