Creating custom message for each hole type in sheet metal drawing.

Creating custom message for each hole type in sheet metal drawing.

Anonymous
Not applicable
526 Views
5 Replies
Message 1 of 6

Creating custom message for each hole type in sheet metal drawing.

Anonymous
Not applicable

Hi All

 

I have a question regarding rules or some automation regarding the hole and thread function in the drawing environment. I have some sheet metal parts to send to fabricators. The sheet metal parts have clearance holes to install self clinch nuts and studs. I want to tell the fabricator if a particular hole is a clearance hole for a screw, clearance hole to install clinch nut or a clearance hole to install a threaded stud.

 

I am following Pemnet fasteners and studs and following their standards to assign specific hole sizes according to the choice of clinch nuts and studs. For example M4 clinch nut needs 5.41mm clearance hole, M5 clinch nut needs 6.35mm clearance hole etc. I want to have a functionality where when I use hole and thread option to indicate the hole size on the drawing it should also diplay have some custom message of what that hole is going to be used for based on the hole size.

 

For example : 5.41 mm thru hole on sheet should indicate something like " Hole for M4 clinch nut"  or 6.35 mm thru hole should say "Hole for M5 clinch nut". If I could add a function of displaying Total quantity for each hole type will be an added bonus. 

 

Is there anyway I can achieve this. Or some other way in which I will be able to mention clearly in the drawing what each hole size stands for. This will save me a lot of time. I have lots of parts and mentioning each hole manually is just a hard work , not a smart work and I can make mistakes.

 

Any help will be much appreciated.  


Thanks in advance

Manjinder

0 Likes
527 Views
5 Replies
Replies (5)
Message 2 of 6

bshbsh
Collaborator
Collaborator

I'd use a hole table with groupings and custom hole infos.

0 Likes
Message 3 of 6

Anonymous
Not applicable
Hi BSHBSH

First of all thank you very much for response to my question.

I tried using hole table. Hole table can tell me hole dimension information
in a table format for a particular view. I am not familiar with groupings
and custom hole infos. Can you please elaborate on that if you don't mind
or direct me to some document where I can read about it.

Moreover, hole table only gives me a overview of a certain view on the
drawing or selection of holes. I want to display all hole types and their
associated functions on the model on the drawings. If I select the hole
table for a certain view (e.g. font view) it gives all the holes on that
view only with tags A1, A2 and so on. I have to use hole table again for a
different view but this time the tags are repeated e.g. A1, A2 ...which
will create confusion to the fabricator. In this situation I will have
same hole tags with different hole information.

Thanks
Manjinder
0 Likes
Message 4 of 6

bshbsh
Collaborator
Collaborator

I thought if it's sheetmetal, it'd have an unfolded view of the flatpattern for laser cutting or punching, and then you could put a hole table on that view and you would have everything.

But I was bored and put together some vba macro. It doesn't work great yet and is very half-assed but I haven't got more time now, sorry. Play with it if you want.

You will have to disable the "option explicit" coz i'm lazy to define things explicitly.

Public Sub HoleNotes()
    On Error Resume Next
        If ThisApplication.ActiveEditDocument.DocumentType <> kDrawingDocumentObject Then
        End
    Else
        Dim InvDoc As Document
        Set InvDoc = ThisApplication.ActiveEditDocument
    End If
    On Error GoTo 0
    
    Dim ExcelApp As Object
    Dim ExcelWB As Object
    Dim ExcelWS As Object
    Set ExcelApp = CreateObject("Excel.Application")
    Set ExcelWB = ExcelApp.Workbooks.Open("D:\Holeinfos.xlsx") 'Change your path here
    Set ExcelWS = ExcelWB.ActiveSheet
    
    For Each DrawingView In InvDoc.ActiveSheet.DrawingViews
        For Each DrawingCurve In DrawingView.DrawingCurves
            If DrawingCurve.ProjectedCurveType = kCircleCurve2d Then
                For Each Face In DrawingCurve.ModelGeometry.Faces
                    If Face.CreatedByFeature.Type = kHoleFeatureObject Then
                        For Each Row In ExcelWS.UsedRange.Rows
                            If Row.Cells(1, 1).Value = InvDoc.UnitsOfMeasure.ConvertUnits(Face.CreatedByFeature.HoleDiameter.Value, kCentimeterLengthUnits, InvDoc.UnitsOfMeasure.LengthUnits) Then
                                Dim pt1 As Point2d
                                Set pt1 = ThisApplication.TransientGeometry.CreatePoint2d
                                Set pt1 = DrawingCurve.CenterPoint.Copy
                                Dim v As Vector2d
                                Set v = ThisApplication.TransientGeometry.CreateVector2d
                                Set v = pt1.VectorTo(DrawingView.Center)
                                Call v.Normalize
                                Call v.ScaleBy(-1)
                                Call pt1.TranslateBy(v)
                                Dim HoleNote As HoleThreadNote
                                Set HoleNote = InvDoc.ActiveSheet.DrawingNotes.HoleThreadNotes.Add(pt1, DrawingCurve)
                                HoleNote.QuantityDefinition = kNumberOfHolesInFeature
                                HoleNote.UseDefaultFormat = False
                                HoleNote.FormattedHoleThreadNote = Row.Cells(1, 2).Text & vbNewLine & "<QTYNOTE>"
                                Exit For
                            End If
                        Next
                    End If
                Next
            End If
        Next
    Next
    ExcelApp.quit
    Set ExcelApp = Nothing
End Sub

This just goes through all the views on the active sheet and adds a holenote to specific holes. It tries to place them somehow but it's not working right, sorry.

You'll also need an Excel document. (for convenience and easy future expanding). This contains a list of hole diameters and the corresponding text you want to put on the holenote. The excel will be very simple: one worksheet (could be more, but the right one has to be active when saving it.). The worksheet has to have column A and B filled in: column A will have the diameters, column B will have the text. For example:

---A---|---B-------------------|

5.41  | Hole for M4 clinch nut|

6.35  | Hole for M5 clinch nut|

etc.

 

0 Likes
Message 5 of 6

Anonymous
Not applicable
Hi bshbsh

Thanks for the reply. I have been talking to the Autodesk support desk too
about my situation. They have given me an idea of how it can be achieved.
It involves what you have told me minus the code. I have to make another
tab in the excel sheet where hole data is pulled from specifically for what
I need to display. And then choose from the drop down menu which comes when
choosing clearance holes type. hopefully it will show the custom profile
which I have made and I will be able to select from that .I will try that
and see of it works.

Will post my results here if it works.

Thanks so so much so far for all your inputs.

Regards
Manjinder
0 Likes
Message 6 of 6

bshbsh
Collaborator
Collaborator

Yes, that method works as well, however it will only work on holes that you create from now on, using the new hole descriptions form your modified table, but it won't change already existing old holes. You have to change all the old holes in the models and in many cases the old hole notes on old drawings too. This is the problem I'm having right now, actually. I have to "update" old drawings to conform new in-house standards and I'm having huge problems with holes and hole notes. Seems quite straightforward to do but I just can't get it to work properly. Reminds me to open a new question. Smiley LOL

0 Likes