Skip to main content
10-Marble
June 28, 2023
Solved

Create a Flat Pattern feature using Creo Toolkit

  • June 28, 2023
  • 1 reply
  • 2207 views

Hello,

I am trying to create a Toolkit in C/C++ that creates the flat Pattern feature for a Creo sheetmetal part.

I tried using the method ProFeatureWithoptionsCreate() described on this article: https://www.ptc.com/en/support/article/CS69107?source=search

But I wasn't able to figure it out what is needed for this method to work.

 

Best answer by GabrielPaes

Thanks for the help, I was able to figure it out on how to use the article code properly.

1 reply

RPN
18-Opal
June 28, 2023

In short, create the feature by yourself, next dump this feature to an xml file, finally create this tree by yourself.

10-Marble
June 29, 2023

I am trying to create the feature using the ProFeatureWithoptionsCreate() but I can't make it work yet, maybe because of some wrong parameters.

But what do you mean by dumping the feature to an xml file?

RPN
18-Opal
June 29, 2023

Here the Feature Dump, you can as well create a feature from xml, and in generell it may easier to create the feature with an UDF, because a flat pattern is a simple feature. 


extern ProError ProElemtreeWrite (
ProElement elemtree,
ProElemtreeFormat format,
ProPath output_file
);

/*
Purpose:
Writes the Element Tree in the specified file in XML format

Input Arguments:
elemtree - root element of the element tree to be printed
format - pass PRO_ELEMTREE_XML
output_file - Full path to the output file,
including extension.

Output Arguments:
none

Return Values:
PRO_TK_NO_ERROR - Successful in writing the element tree
PRO_TK_BAD_INPUTS - Invalid inputs
PRO_TK_GENERAL_ERROR - Errors in generating the output
*/