I Need to create an inspection table with stamped identifiers for each dimension.

I Need to create an inspection table with stamped identifiers for each dimension.

pasupathy_baskar
Participant Participant
190 Views
4 Replies
Message 1 of 5

I Need to create an inspection table with stamped identifiers for each dimension.

pasupathy_baskar
Participant
Participant

Hi Guys,

            I need to create a sketch symbol with a counter that loops through all dimensions and then generate an inspection table listing each dimension along with its tolerance. Sketch Symbol like a Balloon.

I'm beginner to this, so hope you guys help on this 

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

Andrii_Humeniuk
Advisor
Advisor

Hi @pasupathy_baskar .

This is quite a difficult task and requires writing a large piece of code. I suggest you look at similar topics and their solutions: link, link, link.

If you have any questions or suggestions, I will be happy to help.

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

Message 3 of 5

pasupathy_baskar
Participant
Participant

Thanks for the Reply.

Actually, I’m trying to develop the code myself, but I don’t have much experience with programming. I’ve searched on YouTube and online, but I couldn’t find any relevant content.

0 Likes
Message 4 of 5

JelteDeJong
Mentor
Mentor

You're asking for a way to loop through all dimensions on a drawing sheet, place a numbered sketch symbol (like a balloon), and generate an inspection table listing the dimension values and tolerances. Great idea—this is useful for inspection drawings.

Below is a basic iLogic rule that does most of the work. It:

  • Loops through all dimensions on the active sheet
  • Places a numbered balloon (simple leader note) next to each dimension
  • Fills a custom table with the dimension number, nominal value, and tolerance range

I'm not using a sketch symbol in this example because that setup depends heavily on your template and symbol definitions. You can find several good posts on the forum explaining how to insert sketched symbols using SketchedSymbolDefinitions and SketchedSymbols.Add.

 

iLogic Rule (Work-in-Progress, but functional):

Public Sub Main()
    Dim doc As DrawingDocument = ThisDoc.Document
    Dim sheet As Sheet = doc.ActiveSheet

    Dim table As CustomTable = PlaceCustomTable(sheet)

    For i As Integer = 1 To sheet.DrawingDimensions.Count
        Dim dimension As DrawingDimension = sheet.DrawingDimensions.Item(i)
        PlaceBalloon(sheet, dimension, i)
        AddRow(table, dimension, i)
    Next
End Sub

Private Sub AddRow(table As CustomTable, dimension As DrawingDimension, number As Integer)
    Dim value = dimension.ModelValue.ToString("F2") ' Nominal value
    Dim min = dimension.Tolerance.Lower
    Dim max = dimension.Tolerance.Upper
    Dim content As String() = {number, value, min.ToString("F2"), max.ToString("F2")}
    table.Rows.Add(0, True, content)
End Sub

Private Function PlaceCustomTable(sheet As Sheet) As CustomTable
    Dim tableInsertPoint = ThisApplication.TransientGeometry.CreatePoint2d(1, sheet.Height / 2)
    Dim columnTitles As String() = {"No", "Specification", "Min", "Max"}
    Dim table As CustomTable = sheet.CustomTables.Add("Check table", tableInsertPoint, 4, 1, columnTitles)
    table.Rows.Item(1).Delete() ' Remove the initial empty row
    Return table
End Function

Private Sub PlaceBalloon(sheet As Sheet, dimension As DrawingDimension, number As Integer)
    Dim textOrigin As Point2d = dimension.Text.Origin
    Dim leaderPoints As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection()

    ' Example offset for balloon
    leaderPoints.Add(ThisApplication.TransientGeometry.CreatePoint2d(textOrigin.X + 1, textOrigin.Y + 1))
    leaderPoints.Add(textOrigin)

    ' Simple leader note as a placeholder for a balloon/sketch symbol
    sheet.DrawingNotes.LeaderNotes.Add(leaderPoints, number)
End Sub

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 5 of 5

pasupathy_baskar
Participant
Participant

Thanks for your response. I appreciate your time and input.

I Check the code, Balloon dimension and table value look vary, If you finish this kindly let me know

And I will try on my end.

0 Likes