Skip to main content
10-Marble
Jun 28, 2023 2:06 PM UTC
Solved

Create a Flat Pattern feature using Creo Toolkit

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.

 

10-Marble
Jul 3, 2023 6:51 PM UTC

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

4 replies

RPN
18-Opal
Jun 28, 2023 9:06 PM UTC

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

Translate
10-Marble
Jun 29, 2023 12:50 PM UTC

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?

Translate
RPN
18-Opal
Jun 29, 2023 3:01 PM UTC

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
*/

Translate