Hi guys, I am writing a code in which I am opening a part file through my program and reading all its features. But i have one problem, wen we create some model in solidedge and make holes on that, then even if we create multiple holes, the only one Hole_1 name appears in the feature list. And features object also fetch only only one hole as a feature. So what should be the code to get the total number of holes??
Thaks in advance..
Posted by: Chetan Sonawane Post date: 4/12/2010 6:37:57 PM
When you create a hole features as a single hole the object type is igHoleFeatureObject. But when you create multiple holes in a single command (as a single features in the EdgeBar) the object type is igUserDefinedPatternFeatureObject. (This suggests to me that such a features is internally stored as User Defined pattern).
So to get the number of holes in such a feature use the GetNumberOfOccurrences method like this:
I have found that both x and y contain the value of number of holes.
Note that this method does not apply to a hole feature that contains a single hole. So you will have to find out he feature type before applying this method. Also, I have not tested but there might be other features of igUserDefinedPatternFeatureObject type.
So total holes in a Part = no. of igHoleFeatureObject + sum of x in each multipleHoleFeatureObject.GetNumberOfOccurrences
Posted by: Sanjay Kulkarni Post date: 5/6/2010 4:20:16 AM