Custom Hole Note and Tolerances Automatically assigned based on Hole Type

Custom Hole Note and Tolerances Automatically assigned based on Hole Type

RNDinov8r
Collaborator Collaborator
2,677 Views
13 Replies
Message 1 of 14

Custom Hole Note and Tolerances Automatically assigned based on Hole Type

RNDinov8r
Collaborator
Collaborator

So, I know how to create and Edit hole notes, I am wondering if any iLogic or VBA exists that detects the hole "type" and can accordingly assign a specific hole note (specifically for me, tolerances based on type.)

 

Internally, I have edited our hole/thread table file and added "dowel Pin holes". (We were having trouble getting 12 engineers to use the same dimensions based on the dowel pins - we'll leave it at that). As you can see in the image, When I select fastener type, I have the option of "Dowel Pin Hole". You then select a nominal size. (Shown here as M2).

A CLOSE hole is 2.00, a NORMAL hole is 2.025, and a LOOSE hole is 2.050. 

 

When I go into the drawing, I would like to be able to apply hole notes that automatically assign the dimension with a specific tolerance, rather than have to edit the note for every down pin hole I call out. I.E. a CLOSE hole is X.XX+0.0/-0.025, NORMAL hole is X.XX+0.025/-0.00, and LOOSE hole is X.XX+0.025/-0.00. I don't want to have to always go up in my Annotate Tab and select the Style in the Format menu, since I can't tell by looking at the hole what type it is until after I apply the hole note.HoleProperties.png

0 Likes
2,678 Views
13 Replies
Replies (13)
Message 2 of 14

mcgyvr
Consultant
Consultant

Have you seen this?

I'm in a rush but saw this and it seems to be right up your alley..

https://forums.autodesk.com/t5/inventor-customization/ilogic-code-to-add-a-specific-tolerance-to-a-s...

 



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
0 Likes
Message 3 of 14

RNDinov8r
Collaborator
Collaborator

That may be what I needed. I even searched for something like that and came up with nil. I will play with this, and see how it goes.

0 Likes
Message 4 of 14

RNDinov8r
Collaborator
Collaborator

So after pouring through that code, I determined that it runs in an .ipt file, and affects the tolerance property of the hole feature, it does not edit the hole note in the .idw. (That said, it is useful, and I may yet have a use for it).

 

I am looking for something that will automatically apply a dim style to a hole note, based on whethter it is CLOSE, NORMAL, or LOOSE. See image below...i am trying to avoid this edit for every hole, or group of dowel pin holes I have to dimension.

HoleNoteProperties.png

0 Likes
Message 5 of 14

gparamasivam
Enthusiast
Enthusiast

Is possible to control the tolerance based on the which was used in tap size, need to automate with iLogic.

iLogic available?

kindly check the attachments

0 Likes
Message 6 of 14

RNDinov8r
Collaborator
Collaborator

So, Here's what I did.

I created some dim Styles based on hole notes

RNDinov8r_0-1628179024571.png

And then I used this code to figure out what the gemoetry is.

Dim doc As DrawingDocument = ThisDoc.Document

Dim segment As DrawingCurveSegment = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingCurveSegmentFilter, "Select curve")
Dim curve As DrawingCurve = segment.Parent

Dim oFace As Face
Dim oHoleFeature As HoleFeature

If curve.ModelGeometry.Type = ObjectTypeEnum.kFaceObject Then

    oFace = curve.ModelGeometry

    If oFace.CreatedByFeature.Type = ObjectTypeEnum.kHoleFeatureObject Then
        oHoleFeature = oFace.CreatedByFeature
    End If

ElseIf curve.ModelGeometry.Type = ObjectTypeEnum.kEdgeObject Then
    Dim oEdge As Edge = curve.ModelGeometry

    For Each oFace In oEdge.Faces
        If oFace.CreatedByFeature.Type = ObjectTypeEnum.kHoleFeatureObject Then

            oHoleFeature = oFace.CreatedByFeature
        End If
    Next
End If


Dim fastenerType As String = oHoleFeature.ClearanceInfo.FastenerType
Dim FastenerFitType As FastenerFitType = oHoleFeature.ClearanceInfo.FastenerFitType
MsgBox(fastenerType)

If (fastenerType.Equals("Dowel Pin Hole")) Then
    'Dim dimension As GeneralDimension = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingDimensionFilter, "Select dimension")
    Dim dimension As HoleThreadNote = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllEntitiesFilter, "Select Hole Note")
	Dim oDrawDoc As DrawingDocument = ThisDoc.Document
    Dim oStylesMgr As DrawingStylesManager = oDrawDoc.StylesManager


    If (FastenerFitType = FastenerFitType.kCloseFitType) Then
        dimension.Style = oStylesMgr.DimensionStyles.Item("Dowel Pin")
    Else
        dimension.Style = oStylesMgr.DimensionStyles.Item("Dowel Pin Slip")
    End If
End If

If (fastenerType.Equals("Dowel Pin w/ Breather")) Then
    'Dim dimension As GeneralDimension = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingDimensionFilter, "Select dimension")
    Dim dimension As HoleThreadNote = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllEntitiesFilter, "Select Hole Note")
	Dim oDrawDoc As DrawingDocument = ThisDoc.Document
    Dim oStylesMgr As DrawingStylesManager = oDrawDoc.StylesManager


    If (FastenerFitType = FastenerFitType.kCloseFitType) Then
        dimension.Style = oStylesMgr.DimensionStyles.Item("Dowel Pin")
    Else
        dimension.Style = oStylesMgr.DimensionStyles.Item("Dowel Pin Slip")
    End If
End If
0 Likes
Message 7 of 14

gparamasivam
Enthusiast
Enthusiast

Ya Good,

Could you please help me to create the iLogic function.

Actually i have taken the hole callout then i removed the {±TOL} [?] these and Right click>Edit hole note>Precision and tolerance>add tolerance manually which is mentioned below.

Example:

ThreadsizeSeriesMinMax
2.000-8UN-0.0050.015
2.000-12UN-0.0060.016
1.875-6UN-0.0040.014
1.500-8UN-0.0030.015

 

My requirement:

After taken the hole note, click the hole note and use iLogic form >select threadsize (2.000-8UN), the data mentioned tolerance has automatically applies to the hole diameter.

Hope you understand.

0 Likes
Message 8 of 14

RNDinov8r
Collaborator
Collaborator

@gparamasivam 

 

So looking closer at what yo are wanting, it, I think is a little more difficult than the code I posted. 

 

My ilogic allows you to select the hole in the drawing,

RNDinov8r_1-1628253423706.png


Then it looks at the hole fit type and determines the tolerance based on the Dim Style

RNDinov8r_2-1628253463788.png


That being said, these are clearance holes which have Close/Normal/Loose Fits based on the excel file that Invnetor reads from. I will note that I added the dowel pin hole style...that is not out of the box inventor. It is likely the file you are looking for is on your hard drive....we keep ours on the server...
K:\Inventor\R2020 Inventor\R2020 Styles\XLS\en-US\Clearance.xls.

RNDinov8r_3-1628253550973.png
Since the threaded holes use a different table.
K:\Inventor\R2020 Inventor\R2020 Styles\XLS\en-US\Threaded.xls, that is what you would want to add the new Hole type too....BUT..., there are no tolerances on those holes...becuase there isn't Close/Normal/Loose options...

RNDinov8r_4-1628253796815.png

That being said, if you create a new Dimension Style, and associate it to your new thread type in the code, it may work.

RNDinov8r_5-1628254032029.png

 

RNDinov8r_6-1628254149010.png

Hopefully this helps....I unfortunatley don't have time right now to test any new code, but I beleive this path should work.

 

0 Likes
Message 9 of 14

gparamasivam
Enthusiast
Enthusiast

@RNDinov8r 

You very close to my requirement.

Above you told points are currently we doing this practice but need to add the <TDDIA> tolerance by automate by using iLogic forms. please see the attachment, the marked area.  why its appear {±TOL/}? If we know these, we can use this parameter automate.

Hope you understand.

0 Likes
Message 10 of 14

RNDinov8r
Collaborator
Collaborator

I think I figured it out. You want it to look like this? 

RNDinov8r_1-1628258330627.png

In your new dim style, make sure you have Tap Drill box checked. Then when you expand to edit the tolerances, it will show up in the list. 

RNDinov8r_2-1628258398469.png

 

0 Likes
Message 11 of 14

gparamasivam
Enthusiast
Enthusiast

Yes, But its a manual method and this our current practice too.

Every-time i refer from the master data sheet, check the tolerance for required Thread size and add the tolerance in Precision tolerance box .

We need to automate this,

Click the thread note>open iLogic>select the required thread size>Tolerance will add automatically.

If i click 2.000-8UN thread size - 1.875 -.004/+.015 Should add

Capture2.JPG

0 Likes
Message 12 of 14

RNDinov8r
Collaborator
Collaborator

That's what this iLogic Code does via all of the process shown here. 

 

  1. Create a new Hole Style in the Thread.xls sheet and add the hole sizes you want
  2. Create a new DimStyle in your Style manager...where you set that tolerance in your hole note template
  3. Update the code such the that secitons that look for the Hole syle match your new style.
  4. Update the code such that it applies your new dim style hole note (with the tolerances)
  5. Start a drawing.
  6. RMB on the iLogic rule and run it.
  7. Select the hole which you need to apply this tolerancing/hole note too.
  8. follow the prompts.
0 Likes
Message 13 of 14

gparamasivam
Enthusiast
Enthusiast

Kindly send the prompt(iLogic program) 

0 Likes
Message 14 of 14

RNDinov8r
Collaborator
Collaborator

The code was posted previously. You need to change some variable names and create a your own custom hole style and notes and reflect that in the posted code. 

0 Likes