David_Hyper
New member
Hello,
i'd like to have a very very simple example on how to create an extruded sketched feature, not the first feature one,with the section created in code,NO user interaction please. Just a cube with 4 lines.
I am able to create a section and all, but when i call the ProFeatureRedefine it always ask the user to complete it by selecting the sketching plane, even if i get the PRO_E_SKETCHER from the feature tree and set it with my section. Also, when I try to regenrate or solve my section, it awlways gives me an error.
===================================================
path_items[0].type = PRO_ELEM_PATH_ITEM_TYPE_ID;
path_items[0].path_item.elem_id = PRO_E_STD_SECTION;
path_items[1].type = PRO_ELEM_PATH_ITEM_TYPE_ID;
path_items[1].path_item.elem_id = PRO_E_SKETCHER;
status = ProElempathAlloc(&path);
status = ProElempathDataSet(path, path_items, 2);
status = ProElemtreeElementGet(created_elemtree, path, &sketch_element);
status = ProElementValueGet(sketch_element, &value);
status = ProValueDataGet(value, &value_data);
// retrieve section
pSection = (ProSection*)(&value_data.v.p);
// allocate the section .. add lines .. regen .. solve .. etc
//Redefining the feature to make it complete.
opts[0] = PRO_FEAT_CR_DEFINE_MISS_ELEMS;
status = ProSelectionAsmcomppathGet(model_sel, &comp_path);
status = ProFeatureRedefine(&comp_path, &feature, created_elemtree, opts, 1, &errors);
===================================================
What am i doing wrong ?
PS: all the PRO_E_STD_SEC_SETUP_PLANE elementsare set to valid datum planes.
Thx a lot
David
Edited by: David_Hyper
i'd like to have a very very simple example on how to create an extruded sketched feature, not the first feature one,with the section created in code,NO user interaction please. Just a cube with 4 lines.
I am able to create a section and all, but when i call the ProFeatureRedefine it always ask the user to complete it by selecting the sketching plane, even if i get the PRO_E_SKETCHER from the feature tree and set it with my section. Also, when I try to regenrate or solve my section, it awlways gives me an error.
===================================================
path_items[0].type = PRO_ELEM_PATH_ITEM_TYPE_ID;
path_items[0].path_item.elem_id = PRO_E_STD_SECTION;
path_items[1].type = PRO_ELEM_PATH_ITEM_TYPE_ID;
path_items[1].path_item.elem_id = PRO_E_SKETCHER;
status = ProElempathAlloc(&path);
status = ProElempathDataSet(path, path_items, 2);
status = ProElemtreeElementGet(created_elemtree, path, &sketch_element);
status = ProElementValueGet(sketch_element, &value);
status = ProValueDataGet(value, &value_data);
// retrieve section
pSection = (ProSection*)(&value_data.v.p);
// allocate the section .. add lines .. regen .. solve .. etc
//Redefining the feature to make it complete.
opts[0] = PRO_FEAT_CR_DEFINE_MISS_ELEMS;
status = ProSelectionAsmcomppathGet(model_sel, &comp_path);
status = ProFeatureRedefine(&comp_path, &feature, created_elemtree, opts, 1, &errors);
===================================================
What am i doing wrong ?
PS: all the PRO_E_STD_SEC_SETUP_PLANE elementsare set to valid datum planes.
Thx a lot
David
Edited by: David_Hyper