cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

sketch dimension of a feature

Ketan_Lalcheta
19-Tanzanite

sketch dimension of a feature

Hello

I have a Hole feature created using sketch. I am doing feature dimension visit using API ProFeatureDimensionVisit(). This will visit all the dimensions of Hole feature and includes sketch dimension as well as dimensions used to place hole on reference plane.

Is there a way to differentiate sketch dimension or not?

Thanks and Regards

Ketan

2 REPLIES 2

There is no direct function to investigate if a dimension belongs to a sketch or not.

A possible work around is to use ProSectionDimensionIdsGet function. Bellow is the function description from the user guide.

ProError ProSectionDimensionIdsGet ( 
 ProSection section  
 /* (In) 
 The section. 
 */ 
 ProIntlist* sec_dim_id_list  
 /* (Out) 
 The returned array of section dimension identifiers that have corresponding dimensions in the solid. Release the memory using ProArrayFree(). 
 */ 
 ProIntlist* solid_dim_id_list  
 /* (Out) 
 The returned array of solid dimension identifiers. Release the memory using ProArrayFree(). 
 */ 
 int* p_num_ids  
 /* (Out) 
 The size of the two returned lists. 
 */ 
) 

Here is a quick example that I found on one of my applications:

     ProError status;
     ProFeature feature;
     ProElempath path;
     ProElempathItem path_items[2];
     ProSection section;
     ProValue value;
     ProValueData value_data;
     ProElement sketch_element; 
     ProElement created_elemtree; 

 // get the feature element tree
  status = ProFeatureElemtreeCreate ( &feature, &created_elemtree );
  
  //define ProElempathItem array to extract the section element
  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;
  //Define the path for extraction
  status = ProElempathAlloc (&path);
  status = ProElempathDataSet (path, path_items, 2);
  
  //Get the sketch element
  status = ProElemtreeElementGet ( created_elemtree, path, &sketch_element);
  status = ProElementValueGet ( sketch_element, &value);
  status = ProValueDataGet (value, &value_data);
  section = (ProSection)value_data.v.p;
     
     //Section dimension lists
     status = ProSectionDimensionIdsGet(section,&secdim_ids, &mdldim_ids, &n_mdldim_ids);

Hi,

Thank you for this. Does these dimensions change ask to update section?. This will ask for API ProSectionsolve() or not? If so, I would not like to go with this as I have seen this API failure for so many times.

Thanks and Regards

Ketan

Announcements