Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro to count number of specific type of hole?

Status
Not open for further replies.

brrian

Mechanical
Jan 21, 2004
164
I'm hoping that one of you could tell me that this would work...

I need to be able to count the number of instances of a specific type of hole in an assembly (in the assembly's parts).

I can use a specific name in the FeatureManager for that hole type (i.e. DOWEL HOLE) if that would help the macro to find it.

Instances of that hole feature could have several locations (i.e. more than one hole per feature).

Could it work--a macro to traverse through the parts and count all holes named "DOWEL HOLE" (or some other identification method)? Please let me know what you think. Thanks!

Brian
 
Replies continue below

Recommended for you

Would each of the Features be a Hole Wizard or an Cut-Extrude or possibly both?

Ken
 
brrian said:
Could it work--a macro to traverse through the parts and count all holes named "DOWEL HOLE" (or some other identification method)? Please let me know what you think. Thanks!

There is an example in the SW API Help in SW that will traverse all features in a part. Then all you have to do is pick the names that match.

 
There is an Example macro in the API help that returns the number of Sketch Points in a Hole Wizard Sketch for a given Feature Name. It is called: Get Sketch Points in Hole Wizard Feature Example (VB)

"If" you already know the Feature Names, you won't have to Traverse the Tree. But I'd guess you'll need to incorporate Traversing the Tree before you're all said and done with this.

Ken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor