<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Creo Object Toolkit, WCreateFeature in Customization</title>
    <link>https://www.ptcusercommunity.com/t5/Customization/Creo-Object-Toolkit-WCreateFeature/m-p/720181#M10209</link>
    <description>&lt;P&gt;PRO_E_CSYS_ORIENTSELAXIS1_REF and&amp;nbsp;PRO_E_CSYS_ORIENTSELAXIS2_REF must have 'selection' type in XML.&lt;/P&gt;
&lt;P&gt;The shown XML output had listed them as 'null'&lt;/P&gt;
&lt;P&gt;I would check this statement.&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;/*	  Element id:	2142 : PRO_E_CSYS_ORIENTSELAXIS1_REF	*/
	localElem.CreateCompoundElem(PRO_E_CSYS_ORIENTSELAXIS1_REF, 1, newElems);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code does not match what the equivalent Pro/Toolkit code would or should be doing behind the scenes.&lt;/P&gt;
&lt;P&gt;In Pro/Toolkit those elements should be created with ProElementReferenceSet with ProReference ref = NULL;&amp;nbsp; (in versions prior to Creo 4 one would need to allocate ref with ProReferenceAlloc(&amp;amp;ref); as well).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HIH.&lt;/P&gt;</description>
    <pubDate>Mon, 22 Mar 2021 14:59:10 GMT</pubDate>
    <dc:creator>FV</dc:creator>
    <dc:date>2021-03-22T14:59:10Z</dc:date>
    <item>
      <title>Creo Object Toolkit, WCreateFeature</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/Creo-Object-Toolkit-WCreateFeature/m-p/717709#M10190</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to perform a simple feature creation opertaion using the&amp;nbsp;&lt;SPAN&gt;wfcWSolid::WCreateFeature function in otk.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The feature element tree has been generated using the cxx element tree generator provided by PTC and is meant to create a default coordinate system in a part. Here is the element tree def:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;wfcElements_ptr CreateDefaultCoord(pfcModel_ptr Model)
{
	wfcElements_ptr newElems = new wfcElements();
	wfcElement_ptr newElem;
	CreateElem localElem;
	otkxEnums localEnum;
	CollectionHelpers localCollnHelper;

	/*	  Element id:	386 : PRO_E_FEATURE_TREE	*/
	localElem.CreateCompoundElem(PRO_E_FEATURE_TREE, 0, newElems);

	/*	  Element id:	387 : PRO_E_FEATURE_TYPE	*/
	localElem.CreateIntegerElem(PRO_E_FEATURE_TYPE, 979, 1, newElems);

	/*	  Element id:	1964 : PRO_E_STD_FEATURE_NAME	*/
	localElem.CreateStringElem(PRO_E_STD_FEATURE_NAME, "CS0", 1, newElems);

	/*	  Element id:	2134 : PRO_E_CSYS_ORIGIN_CONSTRS	*/
	localElem.CreateCompoundElem(PRO_E_CSYS_ORIGIN_CONSTRS, 1, newElems);

	/*	  Element id:	2147 : PRO_E_CSYS_OFFSET_TYPE	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_OFFSET_TYPE, 0, 1, newElems);

	/*	  Element id:	3953 : PRO_E_CSYS_ONSURF_TYPE	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_ONSURF_TYPE, 0, 1, newElems);

	/*	  Element id:	3954 : PRO_E_CSYS_DIM_CONSTRS	*/
	localElem.CreateCompoundElem(PRO_E_CSYS_DIM_CONSTRS, 1, newElems);

	/*	  Element id:	2137 : PRO_E_CSYS_ORIENTMOVES	*/
	localElem.CreateCompoundElem(PRO_E_CSYS_ORIENTMOVES, 1, newElems);

	/*	  Element id:	3054 : PRO_E_CSYS_NORMAL_TO_SCREEN	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_NORMAL_TO_SCREEN, 0, 1, newElems);

	/*	  Element id:	3050 : PRO_E_CSYS_ORIENT_BY_METHOD	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_ORIENT_BY_METHOD, 0, 1, newElems);

	/*	  Element id:	2142 : PRO_E_CSYS_ORIENTSELAXIS1_REF	*/
	localElem.CreateCompoundElem(PRO_E_CSYS_ORIENTSELAXIS1_REF, 1, newElems);

	/*	  Element id:	3167 : PRO_E_CSYS_ORIENTSELAXIS1_REF_OPT	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_ORIENTSELAXIS1_REF_OPT, 0, 1, newElems);

	/*	  Element id:	2143 : PRO_E_CSYS_ORIENTSELAXIS1_OPT	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_ORIENTSELAXIS1_OPT, 0, 1, newElems);

	/*	  Element id:	3052 : PRO_E_CSYS_ORIENTSELAXIS1_FLIP	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_ORIENTSELAXIS1_FLIP, 0, 1, newElems);

	/*	  Element id:	2144 : PRO_E_CSYS_ORIENTSELAXIS2_REF	*/
	localElem.CreateCompoundElem(PRO_E_CSYS_ORIENTSELAXIS2_REF, 1, newElems);

	/*	  Element id:	3168 : PRO_E_CSYS_ORIENTSELAXIS2_REF_OPT	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_ORIENTSELAXIS2_REF_OPT, 0, 1, newElems);

	/*	  Element id:	2145 : PRO_E_CSYS_ORIENTSELAXIS2_OPT	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_ORIENTSELAXIS2_OPT, 0, 1, newElems);

	/*	  Element id:	3053 : PRO_E_CSYS_ORIENTSELAXIS2_FLIP	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_ORIENTSELAXIS2_FLIP, 0, 1, newElems);

	/*	  Element id:	4123 : PRO_E_CSYS_ORIENTSELAXIS2_ROT_OPT	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_ORIENTSELAXIS2_ROT_OPT, 0, 1, newElems);

	/*	  Element id:	4124 : PRO_E_CSYS_ORIENTSELAXIS2_ROT	*/
	localElem.CreateDoubleElem(PRO_E_CSYS_ORIENTSELAXIS2_ROT, 0, 1, newElems);

	/*	  Element id:	3051 : PRO_E_CSYS_TYPE_MECH	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_TYPE_MECH, 0, 1, newElems);

	/*	  Element id:	3932 : PRO_E_CSYS_FOLLOW_SRF_OPT	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_FOLLOW_SRF_OPT, 0, 1, newElems);

	/*	  Element id:	6133 : PRO_E_CSYS_NAME_DISPLAY_OPT	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_NAME_DISPLAY_OPT, 1, 1, newElems);

	/*	  Element id:	6140 : PRO_E_CSYS_DISPLAY_ZOOM_DEP_OPT	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_DISPLAY_ZOOM_DEP_OPT, 0, 1, newElems);

	/*	  Element id:	6139 : PRO_E_CSYS_AXIS_LENGTH	*/
	localElem.CreateDoubleElem(PRO_E_CSYS_AXIS_LENGTH, 0, 1, newElems);

	return (newElems);
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the remaining code for creating the element tree and adding it to a part solid. The issue is that this code crashes at the WCreateFeature line:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;...
part = pfcPart::cast(wfcGetObjectFromHandle(wfcProMdlHandle, (void*)pro_part));

pfcModel_ptr model = pfcModel::cast(part);
wfcWSolid_ptr wSolid_ptr = wfcWSolid::cast(model);
#pragma endregion

#pragma region Create Coordinate System

wfcFeatCreateOptions_ptr featOpts = wfcFeatCreateOptions::create();
featOpts-&amp;gt;append(wfcFeatCreateOption_nil);

wfcWRegenInstructions_ptr regenInstr = wfcWRegenInstructions::Create();

wfcElements_ptr elements = CreateDefaultCoord(model);
wfcElementTree_ptr elementTree = session-&amp;gt;CreateElementTree(elements);
	
try
{
	wfcWFeature_ptr feature = wSolid_ptr-&amp;gt;WCreateFeature(elementTree, featOpts, regenInstr); &amp;lt;-- Crash
}
catch (const std::exception&amp;amp; e)
{
	throw e;
}
...&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have any idea of why this does not work?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind Regards&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 16:18:36 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/Creo-Object-Toolkit-WCreateFeature/m-p/717709#M10190</guid>
      <dc:creator>Daniel</dc:creator>
      <dc:date>2021-03-09T16:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: Creo Object Toolkit, WCreateFeature</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/Creo-Object-Toolkit-WCreateFeature/m-p/717968#M10195</link>
      <description>&lt;LI-CODE lang="cpp"&gt;wfcElements_ptr CreateDefaultCoord(pfcModel_ptr Model)
&lt;/LI-CODE&gt;
&lt;P&gt;this one is questionable - returning a pointer to an object&amp;nbsp; which supposedly keeps a record of its references, while the pointed object goes out of scope...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;CreateElem localElem;&lt;/LI-CODE&gt;
&lt;P&gt;this one is also questionable - some kind of a 'helper' instance initiated on stack. Impossible to know if it is doing what it should be doing...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;would be a good idea to serialize elementTree&amp;nbsp; after this call:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;wfcElementTree_ptr elementTree = session-&amp;gt;CreateElementTree(elements);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;to see if a tree was populated and if it was a valid one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;also, enum's are from pro/toolkit and the code looks like it had been written in otk_cpp style.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 18:34:42 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/Creo-Object-Toolkit-WCreateFeature/m-p/717968#M10195</guid>
      <dc:creator>FV</dc:creator>
      <dc:date>2021-03-10T18:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Creo Object Toolkit, WCreateFeature</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/Creo-Object-Toolkit-WCreateFeature/m-p/720095#M10208</link>
      <description>&lt;P&gt;Your first point might have something to do with it, but my hesitation to believe so is that the code you've mentioned is created by PTC.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Removing&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;CreateElem localElem;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Equals the same error.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A deserialized version looks like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;PRO_E_FEATURE_TREE  AppName="Pro/ENGINEER" AppVersion="6.0"
	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	 xsi:noNamespaceSchemaLocation="ProTKFeature.xsd" type="compound"&amp;gt;
  &amp;lt;PRO_E_FEATURE_TYPE type="int"&amp;gt;PRO_FEAT_CSYS&amp;lt;/PRO_E_FEATURE_TYPE&amp;gt;
  &amp;lt;PRO_E_STD_FEATURE_NAME type="wstring"&amp;gt;CS0&amp;lt;/PRO_E_STD_FEATURE_NAME&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIGIN_CONSTRS type="array"&amp;gt;
  &amp;lt;/PRO_E_CSYS_ORIGIN_CONSTRS&amp;gt;
  &amp;lt;PRO_E_CSYS_OFFSET_TYPE type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_OFFSET_TYPE&amp;gt;
  &amp;lt;PRO_E_CSYS_ONSURF_TYPE type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ONSURF_TYPE&amp;gt;
  &amp;lt;PRO_E_CSYS_DIM_CONSTRS type="array"&amp;gt;
  &amp;lt;/PRO_E_CSYS_DIM_CONSTRS&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTMOVES type="array"&amp;gt;
  &amp;lt;/PRO_E_CSYS_ORIENTMOVES&amp;gt;
  &amp;lt;PRO_E_CSYS_NORMAL_TO_SCREEN type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_NORMAL_TO_SCREEN&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENT_BY_METHOD type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENT_BY_METHOD&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS1_REF&amp;gt;&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS1_REF&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS1_REF_OPT type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS1_REF_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS1_OPT type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS1_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS1_FLIP type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS1_FLIP&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS2_REF&amp;gt;&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS2_REF&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS2_REF_OPT type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS2_REF_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS2_OPT type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS2_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS2_FLIP type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS2_FLIP&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS2_ROT_OPT type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS2_ROT_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS2_ROT type="double"&amp;gt;0.000000&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS2_ROT&amp;gt;
  &amp;lt;PRO_E_CSYS_TYPE_MECH type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_TYPE_MECH&amp;gt;
  &amp;lt;PRO_E_CSYS_FOLLOW_SRF_OPT type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_FOLLOW_SRF_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_NAME_DISPLAY_OPT type="int"&amp;gt;1&amp;lt;/PRO_E_CSYS_NAME_DISPLAY_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_DISPLAY_ZOOM_DEP_OPT type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_DISPLAY_ZOOM_DEP_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_AXIS_LENGTH type="double"&amp;gt;0.000000&amp;lt;/PRO_E_CSYS_AXIS_LENGTH&amp;gt;
&amp;lt;/PRO_E_FEATURE_TREE&amp;gt;
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Further details are that the error is of class pfcXToolkitGeneralError.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 10:27:14 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/Creo-Object-Toolkit-WCreateFeature/m-p/720095#M10208</guid>
      <dc:creator>Daniel</dc:creator>
      <dc:date>2021-03-22T10:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Creo Object Toolkit, WCreateFeature</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/Creo-Object-Toolkit-WCreateFeature/m-p/720181#M10209</link>
      <description>&lt;P&gt;PRO_E_CSYS_ORIENTSELAXIS1_REF and&amp;nbsp;PRO_E_CSYS_ORIENTSELAXIS2_REF must have 'selection' type in XML.&lt;/P&gt;
&lt;P&gt;The shown XML output had listed them as 'null'&lt;/P&gt;
&lt;P&gt;I would check this statement.&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;/*	  Element id:	2142 : PRO_E_CSYS_ORIENTSELAXIS1_REF	*/
	localElem.CreateCompoundElem(PRO_E_CSYS_ORIENTSELAXIS1_REF, 1, newElems);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code does not match what the equivalent Pro/Toolkit code would or should be doing behind the scenes.&lt;/P&gt;
&lt;P&gt;In Pro/Toolkit those elements should be created with ProElementReferenceSet with ProReference ref = NULL;&amp;nbsp; (in versions prior to Creo 4 one would need to allocate ref with ProReferenceAlloc(&amp;amp;ref); as well).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HIH.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 14:59:10 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/Creo-Object-Toolkit-WCreateFeature/m-p/720181#M10209</guid>
      <dc:creator>FV</dc:creator>
      <dc:date>2021-03-22T14:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Creo Object Toolkit, WCreateFeature</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/Creo-Object-Toolkit-WCreateFeature/m-p/720840#M10210</link>
      <description>&lt;P&gt;You try this, with an empty part? I guess this feature requires to be in insert mode (if the part is not empty), and it should be feature #1. And the feature name needs to be unique as well, only to be mentioned.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 07:36:48 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/Creo-Object-Toolkit-WCreateFeature/m-p/720840#M10210</guid>
      <dc:creator>RPN</dc:creator>
      <dc:date>2021-03-25T07:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Creo Object Toolkit, WCreateFeature</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/Creo-Object-Toolkit-WCreateFeature/m-p/720856#M10211</link>
      <description>&lt;P&gt;Well identified, I've observed a difference between what the&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;WriteElementTreeToFile() method outputs and what&amp;nbsp;CreateElementTreeFromXML() -&amp;gt;&amp;nbsp;WriteElementTreeToFile() outputs.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;I ran the OTKXWriteFeatAsCxx on a coordinate system with&amp;nbsp;&lt;SPAN&gt;WriteElementTreeToFile() added to the process and the output was following:&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;PRO_E_FEATURE_TREE  AppName="Pro/ENGINEER" AppVersion="6.0"
	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	 xsi:noNamespaceSchemaLocation="ProTKFeature.xsd" type="compound"&amp;gt;
  &amp;lt;PRO_E_FEATURE_TYPE type="int"&amp;gt;PRO_FEAT_CSYS&amp;lt;/PRO_E_FEATURE_TYPE&amp;gt;
  &amp;lt;PRO_E_STD_FEATURE_NAME type="wstring"&amp;gt;DEFAULT&amp;lt;/PRO_E_STD_FEATURE_NAME&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIGIN_CONSTRS type="array"&amp;gt;
  &amp;lt;/PRO_E_CSYS_ORIGIN_CONSTRS&amp;gt;
  &amp;lt;PRO_E_CSYS_OFFSET_TYPE type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_OFFSET_TYPE&amp;gt;
  &amp;lt;PRO_E_CSYS_ONSURF_TYPE type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ONSURF_TYPE&amp;gt;
  &amp;lt;PRO_E_CSYS_DIM_CONSTRS type="array"&amp;gt;
  &amp;lt;/PRO_E_CSYS_DIM_CONSTRS&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTMOVES type="array"&amp;gt;
  &amp;lt;/PRO_E_CSYS_ORIENTMOVES&amp;gt;
  &amp;lt;PRO_E_CSYS_NORMAL_TO_SCREEN type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_NORMAL_TO_SCREEN&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENT_BY_METHOD type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENT_BY_METHOD&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS1_REF type="selection"&amp;gt;&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS1_REF&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS1_REF_OPT type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS1_REF_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS1_OPT type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS1_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS1_FLIP type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS1_FLIP&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS2_REF type="selection"&amp;gt;&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS2_REF&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS2_REF_OPT type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS2_REF_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS2_OPT type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS2_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS2_FLIP type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS2_FLIP&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS2_ROT_OPT type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS2_ROT_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS2_ROT type="double"&amp;gt;0.000000&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS2_ROT&amp;gt;
  &amp;lt;PRO_E_CSYS_TYPE_MECH type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_TYPE_MECH&amp;gt;
  &amp;lt;PRO_E_CSYS_FOLLOW_SRF_OPT type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_FOLLOW_SRF_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_NAME_DISPLAY_OPT type="int"&amp;gt;1&amp;lt;/PRO_E_CSYS_NAME_DISPLAY_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_DISPLAY_ZOOM_DEP_OPT type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_DISPLAY_ZOOM_DEP_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_AXIS_LENGTH type="double"&amp;gt;0.000000&amp;lt;/PRO_E_CSYS_AXIS_LENGTH&amp;gt;
&amp;lt;/PRO_E_FEATURE_TREE&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this is then loaded with&amp;nbsp;&lt;SPAN&gt;CreateElementTreeFromXML() and saved with WriteElementTreeToFile() the following is written:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;PRO_E_FEATURE_TREE  AppName="Pro/ENGINEER" AppVersion="6.0"
	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	 xsi:noNamespaceSchemaLocation="ProTKFeature.xsd" type="compound"&amp;gt;
  &amp;lt;PRO_E_FEATURE_TYPE type="int"&amp;gt;PRO_FEAT_CSYS&amp;lt;/PRO_E_FEATURE_TYPE&amp;gt;
  &amp;lt;PRO_E_STD_FEATURE_NAME type="wstring"&amp;gt;DEFAULT&amp;lt;/PRO_E_STD_FEATURE_NAME&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIGIN_CONSTRS type="array"&amp;gt;
  &amp;lt;/PRO_E_CSYS_ORIGIN_CONSTRS&amp;gt;
  &amp;lt;PRO_E_CSYS_OFFSET_TYPE type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_OFFSET_TYPE&amp;gt;
  &amp;lt;PRO_E_CSYS_ONSURF_TYPE type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ONSURF_TYPE&amp;gt;
  &amp;lt;PRO_E_CSYS_DIM_CONSTRS type="array"&amp;gt;
  &amp;lt;/PRO_E_CSYS_DIM_CONSTRS&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTMOVES type="array"&amp;gt;
  &amp;lt;/PRO_E_CSYS_ORIENTMOVES&amp;gt;
  &amp;lt;PRO_E_CSYS_NORMAL_TO_SCREEN type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_NORMAL_TO_SCREEN&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENT_BY_METHOD type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENT_BY_METHOD&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS1_REF_OPT type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS1_REF_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS1_OPT type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS1_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS1_FLIP type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS1_FLIP&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS2_REF_OPT type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS2_REF_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS2_OPT type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS2_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS2_FLIP type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS2_FLIP&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS2_ROT_OPT type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS2_ROT_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_ORIENTSELAXIS2_ROT type="double"&amp;gt;0.000000&amp;lt;/PRO_E_CSYS_ORIENTSELAXIS2_ROT&amp;gt;
  &amp;lt;PRO_E_CSYS_TYPE_MECH type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_TYPE_MECH&amp;gt;
  &amp;lt;PRO_E_CSYS_FOLLOW_SRF_OPT type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_FOLLOW_SRF_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_NAME_DISPLAY_OPT type="int"&amp;gt;1&amp;lt;/PRO_E_CSYS_NAME_DISPLAY_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_DISPLAY_ZOOM_DEP_OPT type="int"&amp;gt;0&amp;lt;/PRO_E_CSYS_DISPLAY_ZOOM_DEP_OPT&amp;gt;
  &amp;lt;PRO_E_CSYS_AXIS_LENGTH type="double"&amp;gt;0.000000&amp;lt;/PRO_E_CSYS_AXIS_LENGTH&amp;gt;
&amp;lt;/PRO_E_FEATURE_TREE&amp;gt;
&lt;/LI-CODE&gt;
&lt;P&gt;But I cant verify if this is the root cause.&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 25 Mar 2021 09:14:14 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/Creo-Object-Toolkit-WCreateFeature/m-p/720856#M10211</guid>
      <dc:creator>Daniel</dc:creator>
      <dc:date>2021-03-25T09:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: Creo Object Toolkit, WCreateFeature</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/Creo-Object-Toolkit-WCreateFeature/m-p/720857#M10212</link>
      <description>&lt;P&gt;This is done with a empty part, so the feature should be unique.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 09:15:15 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/Creo-Object-Toolkit-WCreateFeature/m-p/720857#M10212</guid>
      <dc:creator>Daniel</dc:creator>
      <dc:date>2021-03-25T09:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: Creo Object Toolkit, WCreateFeature</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/Creo-Object-Toolkit-WCreateFeature/m-p/720924#M10214</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/392053"&gt;@Daniel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;This is done with a empty part, so the feature should be unique.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;write a default csys feature tree into an xml file. Make a datum plane in an empty part and add a default csys after the plane with CreateElementTreeFromXML(...) . Delete the plane.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 12:53:47 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/Creo-Object-Toolkit-WCreateFeature/m-p/720924#M10214</guid>
      <dc:creator>FV</dc:creator>
      <dc:date>2021-03-25T12:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: Creo Object Toolkit, WCreateFeature</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/Creo-Object-Toolkit-WCreateFeature/m-p/721131#M10215</link>
      <description>&lt;P&gt;Did you succeeded doing this programatically? I tried it and it work with creating the dtm planes, but it still crashes at the creation of the dtm CSYS.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 07:50:08 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/Creo-Object-Toolkit-WCreateFeature/m-p/721131#M10215</guid>
      <dc:creator>Daniel</dc:creator>
      <dc:date>2021-03-26T07:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: Creo Object Toolkit, WCreateFeature</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/Creo-Object-Toolkit-WCreateFeature/m-p/721145#M10216</link>
      <description>&lt;P&gt;Solved this issue by first creating dtm planes and then the coord using the following element tree:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;wfcElements_ptr CreateFeature_7(pfcModel_ptr Model)
{
	wfcElements_ptr newElems = new wfcElements();
	wfcElement_ptr newElem;
	CreateElem localElem;
	otkxEnums localEnum;
	CollectionHelpers localCollnHelper;

	/*	  Element id:	386 : PRO_E_FEATURE_TREE	*/
	localElem.CreateCompoundElem(PRO_E_FEATURE_TREE, 0, newElems);

	/*	  Element id:	387 : PRO_E_FEATURE_TYPE	*/
	localElem.CreateIntegerElem(PRO_E_FEATURE_TYPE, 979, 1, newElems);

	/*	  Element id:	1964 : PRO_E_STD_FEATURE_NAME	*/
	localElem.CreateStringElem(PRO_E_STD_FEATURE_NAME, "CS1", 1, newElems);

	/*	  Element id:	2134 : PRO_E_CSYS_ORIGIN_CONSTRS	*/
	localElem.CreateCompoundElem(PRO_E_CSYS_ORIGIN_CONSTRS, 1, newElems);

	/*	  Element id:	2135 : PRO_E_CSYS_ORIGIN_CONSTR	*/
	localElem.CreateCompoundElem(PRO_E_CSYS_ORIGIN_CONSTR, 2, newElems);

	/*	  Element id:	2136 : PRO_E_CSYS_ORIGIN_CONSTR_REF	*/
	localElem.CreateSelectionElem(PRO_E_CSYS_ORIGIN_CONSTR_REF, 3, Model, 1, 2, newElems);

	/*	  Element id:	2135 : PRO_E_CSYS_ORIGIN_CONSTR	*/
	localElem.CreateCompoundElem(PRO_E_CSYS_ORIGIN_CONSTR, 2, newElems);

	/*	  Element id:	2136 : PRO_E_CSYS_ORIGIN_CONSTR_REF	*/
	localElem.CreateSelectionElem(PRO_E_CSYS_ORIGIN_CONSTR_REF, 3, Model, 1, 4, newElems);

	/*	  Element id:	2135 : PRO_E_CSYS_ORIGIN_CONSTR	*/
	localElem.CreateCompoundElem(PRO_E_CSYS_ORIGIN_CONSTR, 2, newElems);

	/*	  Element id:	2136 : PRO_E_CSYS_ORIGIN_CONSTR_REF	*/
	localElem.CreateSelectionElem(PRO_E_CSYS_ORIGIN_CONSTR_REF, 3, Model, 1, 6, newElems);

	/*	  Element id:	2147 : PRO_E_CSYS_OFFSET_TYPE	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_OFFSET_TYPE, 0, 1, newElems);

	/*	  Element id:	3953 : PRO_E_CSYS_ONSURF_TYPE	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_ONSURF_TYPE, 0, 1, newElems);

	/*	  Element id:	3954 : PRO_E_CSYS_DIM_CONSTRS	*/
	localElem.CreateCompoundElem(PRO_E_CSYS_DIM_CONSTRS, 1, newElems);

	/*	  Element id:	2137 : PRO_E_CSYS_ORIENTMOVES	*/
	localElem.CreateCompoundElem(PRO_E_CSYS_ORIENTMOVES, 1, newElems);

	/*	  Element id:	3054 : PRO_E_CSYS_NORMAL_TO_SCREEN	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_NORMAL_TO_SCREEN, 0, 1, newElems);

	/*	  Element id:	3050 : PRO_E_CSYS_ORIENT_BY_METHOD	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_ORIENT_BY_METHOD, 0, 1, newElems);

	/*	  Element id:	2142 : PRO_E_CSYS_ORIENTSELAXIS1_REF	*/
	localElem.CreateSelectionElem(PRO_E_CSYS_ORIENTSELAXIS1_REF, 1, Model, 1, 2, newElems);

	/*	  Element id:	3167 : PRO_E_CSYS_ORIENTSELAXIS1_REF_OPT	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_ORIENTSELAXIS1_REF_OPT, 0, 1, newElems);

	/*	  Element id:	2143 : PRO_E_CSYS_ORIENTSELAXIS1_OPT	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_ORIENTSELAXIS1_OPT, 0, 1, newElems);

	/*	  Element id:	3052 : PRO_E_CSYS_ORIENTSELAXIS1_FLIP	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_ORIENTSELAXIS1_FLIP, 0, 1, newElems);

	/*	  Element id:	2144 : PRO_E_CSYS_ORIENTSELAXIS2_REF	*/
	localElem.CreateSelectionElem(PRO_E_CSYS_ORIENTSELAXIS2_REF, 1, Model, 1, 4, newElems);

	/*	  Element id:	3168 : PRO_E_CSYS_ORIENTSELAXIS2_REF_OPT	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_ORIENTSELAXIS2_REF_OPT, 0, 1, newElems);

	/*	  Element id:	2145 : PRO_E_CSYS_ORIENTSELAXIS2_OPT	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_ORIENTSELAXIS2_OPT, 1, 1, newElems);

	/*	  Element id:	3053 : PRO_E_CSYS_ORIENTSELAXIS2_FLIP	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_ORIENTSELAXIS2_FLIP, 0, 1, newElems);

	/*	  Element id:	4123 : PRO_E_CSYS_ORIENTSELAXIS2_ROT_OPT	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_ORIENTSELAXIS2_ROT_OPT, 0, 1, newElems);

	/*	  Element id:	4124 : PRO_E_CSYS_ORIENTSELAXIS2_ROT	*/
	localElem.CreateDoubleElem(PRO_E_CSYS_ORIENTSELAXIS2_ROT, 0, 1, newElems);

	/*	  Element id:	3051 : PRO_E_CSYS_TYPE_MECH	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_TYPE_MECH, 0, 1, newElems);

	/*	  Element id:	3932 : PRO_E_CSYS_FOLLOW_SRF_OPT	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_FOLLOW_SRF_OPT, 0, 1, newElems);

	/*	  Element id:	6133 : PRO_E_CSYS_NAME_DISPLAY_OPT	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_NAME_DISPLAY_OPT, 1, 1, newElems);

	/*	  Element id:	6140 : PRO_E_CSYS_DISPLAY_ZOOM_DEP_OPT	*/
	localElem.CreateIntegerElem(PRO_E_CSYS_DISPLAY_ZOOM_DEP_OPT, 0, 1, newElems);

	/*	  Element id:	6139 : PRO_E_CSYS_AXIS_LENGTH	*/
	localElem.CreateDoubleElem(PRO_E_CSYS_AXIS_LENGTH, 0, 1, newElems);


	return (newElems);
}
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks to everyone who participate in helping me out!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 09:26:54 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/Creo-Object-Toolkit-WCreateFeature/m-p/721145#M10216</guid>
      <dc:creator>Daniel</dc:creator>
      <dc:date>2021-03-26T09:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: Creo Object Toolkit, WCreateFeature</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/Creo-Object-Toolkit-WCreateFeature/m-p/721181#M10217</link>
      <description>&lt;P&gt;works fine using Pro/Toolkit API's...&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 12:56:06 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/Creo-Object-Toolkit-WCreateFeature/m-p/721181#M10217</guid>
      <dc:creator>FV</dc:creator>
      <dc:date>2021-03-26T12:56:06Z</dc:date>
    </item>
  </channel>
</rss>

