Holepattern And count holes

Holepattern And count holes

Jesper_S
Collaborator Collaborator
440 Views
1 Reply
Message 1 of 2

Holepattern And count holes

Jesper_S
Collaborator
Collaborator

Hi.

 

Im trying to make a special holepattern using iFeature. 

Going to use it to make ha holedisk for meat grinders.

 

Holepattern.JPG

I have created a set of three holes in a "Delta-Shape" and then i do a rect. pattern of that feature. The left hole of the "Delta-Shape" will "overlap" the right hole when i do the pattern. (Maybe not the best way to do this).

Is there a way to count the holes made in the part or count them in the drawing? Can have from 10 holes up to 200 or even more.

 

//Jesper


//Jesper

Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
0 Likes
441 Views
1 Reply
Reply (1)
Message 2 of 2

b.mccarthy
Collaborator
Collaborator

Hello.

 

I found this code in the forums, which may do what you want, the caveat being that it only runs on a sheet metal parts. It counts "Edge Loops" not actual "Holes", but it returns the correct values:

 

Dim oDoc As PartDocument = ThisDoc.Document

If oDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then

  Dim oCD As SheetMetalComponentDefinition = oDoc.ComponentDefinition
  If oCD.HasFlatPattern = False Then 
	oCD.Unfold
	oCD.FlatPattern.ExitEdit
  End If

  Dim oFace As Face = oCD.FlatPattern.TopFace
  Dim i As Integer = oFace.EdgeLoops.Count-1

  MessageBox.Show("Number of Holes: " & i)

End If

2023-11-25 722.jpg 

 

I developed my part as you did (created the delta shaped holes and patterned) and converted to sheet metal.

 

My coding skills are poor at best, so I do not know how to modify it to count holes in a standard part.

 

HTH

0 Likes