IV 2012 API (VBA) - kNumberOfHolesInFeature

IV 2012 API (VBA) - kNumberOfHolesInFeature

Anonymous
Not applicable
368 Views
3 Replies
Message 1 of 4

IV 2012 API (VBA) - kNumberOfHolesInFeature

Anonymous
Not applicable

Is it possible to return this without generating a drawing? if not, is there another way to get all kHoleFeatureObjects?

0 Likes
369 Views
3 Replies
Replies (3)
Message 2 of 4

philippe.leefsma
Alumni
Alumni

Hi,

 

You would need to be a bit more specific... Are you looking for accessing all HoleFaeture in a part for example or to know the number of holes in a single HoleFeature?

 

A HoleFeature can contains several holes only if its PlacementDefinition is of type SketchHolePlacementDefinition, in that case you can check the HoleCenterPoints property to know the number of holes.

 

To now the total number of HoleFeatures, you can check the Count of HoleFeatures in your component definition.

 

I hope it helps.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 4

Anonymous
Not applicable

Thank you for the reply.

 

I would like to return the count of holes actually affecting the Solid Body within the Part Document with a single Solid body. I would NOT like to just count the model features that are hole types ( some holes can be outside of the solid body ). A very simple example would  be a Solid with (1) hole features with (2) points drilled in one face and the hole feature belongs to a Mirror Feature I would like return from the solid (4) total holes.

 

I can loop through the faces of a solid and return the CreateByFeature.Type but this does not work well if the hole is OwnedBy a Mirror or a Pattern.

 

How can I get to the Total Number Holes Affecting

 

I can get the QTY of all the holes on a IDW if I use the hole leader I am trying to get this Same data Via the API

 

 

0 Likes
Message 4 of 4

philippe.leefsma
Alumni
Alumni

Unfortunately I don't see a direct way to retrieve this information. The approach you suggest is also the first that comes to my mind: iterating through each face and check the feature that creates it. if the feature is a HoleFeature, then count it, if it is a mirror or a pattern, check the participant features in order to detect if they contain holes. This seems to me rather straightforward to achieve.

 

Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

0 Likes