Automatic Hole Feature drill in the Part

Automatic Hole Feature drill in the Part

hbilla
Participant Participant
198 Views
4 Replies
Message 1 of 5

Automatic Hole Feature drill in the Part

hbilla
Participant
Participant

Hi All,
At Present in an Assembly there will be so many parts. for each part we will drill hole manually using hole feature (like sketch, then hole feature).

now i want to automate this one.
1. i will select one face in a part which has a holes.

2. then the macro must automate the respected holes to another face which has contact to that part.(like for clearance --tap hole like that..) mainly for base plates it will be very useful.

if any body can help.
or else give me at-least the steps which come around so that i will also try from my end.

0 Likes
199 Views
4 Replies
Replies (4)
Message 2 of 5

ryan.rittenhouse
Advocate
Advocate

I have to do similar operations in our engineer to order assemblies. Here's the basics of how we make it work:

 

- Once you click on the face that has holes, go through all of the holes to make a list (we also sort by type to make creating go quicker).

- Find the mating face. We go through the constraints and verify by measuring distance, but you could also just click the opposing face

- Find the center line of each of the holes. You'll need to create a proxy for it since you're jumping parts

- Find the intesection points of each of the center lines and the surface of the mated parts.  

Dim foundPoints As ObjectsEnumerator = ThisApplication.TransientGeometry.CurveSurfaceIntersection(centerLine, targetFace.Geometry)

-Next you can either go one at a time by creating a workpoint in the part and adding the hole feature directly, or by creating a sketch, putting the point locations on a sketch, and adding all the points at once. Both ways work. If you're creating the workpoint we use the following function and hand it the foundPoint from above:

Function CreateWorkPointInComponent(comp As ComponentOccurrence, pointLocation As Point) As WorkPoint
	
	Dim compMatrix As Matrix = comp.Transformation.Copy
	compMatrix.Invert
	Dim newPoint As Point = pointLocation.Copy
	newPoint.TransformBy(compMatrix)
	Return comp.Definition.WorkPoints.AddFixed(newPoint)

End Function

If you're doing them one at a time and especially if it's a curved surface you are poking the hole in, you can create a work axis tangent to the face and use that along w/ the work point to create the hole feature without creating a sketch

	Dim def As PartComponentDefinition = GetDefinition(comp)
	Dim holePlacementDef As PointHolePlacementDefinition = def.Features.HoleFeatures.CreatePointPlacementDefinition(holePoint, holeAxis)
	Dim newHole As HoleFeature = def.Features.HoleFeatures.AddDrilledByDistanceExtent(holePlacementDef, holeDiameter, holeDepth, holeDirection)

 

The Hole creation documentation in the API is actually halfway decent and makes a good reference once you're ready to start creating the hole features. This should at least get you going in a helpful direction, but feel free to ask questions if you'd like me to clarify anything.

If this solved your problem, or answered your question, please click Accept Solution.
0 Likes
Message 3 of 5

jnowel
Advocate
Advocate

not affiliated with the developer @JhoelForshav, but have you tried the Hole Projector Add-in?
it is free at the App Store
Hole Projector | Inventor | Autodesk App Store

Message 4 of 5

hbilla
Participant
Participant

hi Jhoel i tried it.
In this hole projector, the same hole is going to drill on the other part.
what i actually need is when we select a thread hole in one part, in other part it has to drill clearance of respected thread type(for example- m8thread we need dia 9 clearance. m10 thread we need dia 11 clearance holes.)

0 Likes
Message 5 of 5

hbilla
Participant
Participant

Hello  ryan.rittenhouse,
i am trying your method but it will take some time for me to work.
thanks for your help .
i will let you know when it is done.

0 Likes