iLogic - change hole with thread

iLogic - change hole with thread

Anonymous
Not applicable
1,223 Views
3 Replies
Message 1 of 4

iLogic - change hole with thread

Anonymous
Not applicable

Hello,

 

I need help with my problém.

I need rule for change size of thread hole.

 

For example i need ISO metric  M5 and other times M10, M20.

I tried a lot of rules, but anyone not function.

 

Thank you so much

Marek S.

 

Výstřižek.PNG

0 Likes
1,224 Views
3 Replies
Replies (3)
Message 2 of 4

JhoelForshav
Mentor
Mentor

Hi @Anonymous 

You'll need to create a HoleTapInfo object.

Short example:

Dim oDef As PartComponentDefinition = ThisDoc.Document.ComponentDefinition
'----------------------------------------Example of TapInfo------------------------------------------------------------------------
Dim oTapInfo As HoleTapInfo = oDef.Features.HoleFeatures.CreateTapInfo(True, "ISO Metric Profile", "M10x1.25", "6H", False, "10mm")
'-----------------------------------------------------------------------------------------------------------------------------------
Dim oHole As HoleFeature = oDef.Features.HoleFeatures.Item(1)
oHole.TapInfo = oTapInfo
0 Likes
Message 3 of 4

Sergio.D.Suárez
Mentor
Mentor

Hi, try the following rule. I have left you as comments the instructions on how to change the rest of the holes in your list.
There may be problems with Inventor languages, however I have tried this code in Spanish and it worked for me.
I attached a part model in Inv 2018 with the ilogic rule.

Dim oDoc As PartDocument = ThisDoc.Document
Dim oCD As ComponentDefinition = oDoc.ComponentDefinition

Dim oHoleFeature As HoleFeature = oCD.Features.HoleFeatures.Item(1)

'define tap info
oRightHand = True
oThreadStandard = "ISO Metric profile" 
'oThreadDes = "M5x0.8"
'oThreadDes = "M10x1.5"
oThreadDes = "M20x2.5"
oClass = "6H"
oFullThread = True

'Set hole As tapped
Dim oTappedInfo As HoleTapInfo = oCD.Features.HoleFeatures.CreateTapInfo(oRightHand, oThreadStandard, oThreadDes, oClass, oFullThread)
oHoleFeature.TapInfo = oTappedInfo

 I hope this helps with your problem. regards


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

0 Likes
Message 4 of 4

Anonymous
Not applicable

This rule works for me, but i need something else.

 

I need rule where I have:

 

If.. (Thread=M5) Then
Change this hole with thread at M5
End if

And next
..
.
If ...(Thread= M10) then

Change this hole with thread at M10

etc..

0 Likes