Item # Balloon locator

Item # Balloon locator

Anonymous
Not applicable
445 Views
2 Replies
Message 1 of 3

Item # Balloon locator

Anonymous
Not applicable

Gang,

Probably a long shot.... In an .idw, is it possible for Inventor to auto populate on my BOM where the first used balloon is. On our drawings we identify within a column on our BOM that specifies what sheet and zone the first callout of a balloon is located. With BOM's sometimes containing over 100 item #'s this proves useful to our assemblers as it saves them the time of flipping through a 20-30 page drawing to find a balloon. This is currently handled with manual inputs from our designers. Adding or removing a sheet from the drawing or additional item #'s introduces opportunity for errors and our current method is very daunting. See attached.

 

Thank you in advance!

Shawn

0 Likes
446 Views
2 Replies
Replies (2)
Message 2 of 3

JelteDeJong
Mentor
Mentor

i dont know a standard function that does that but i wrote a ilogic rule that does this.

[iLogic]

Dim COLUMNNAME = "First used"

Dim doc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheet As Sheet = doc.ActiveSheet
Dim partsList As PartsList = oSheet.PartsLists.Item(1)

' collect item numbers, sheet numbers and location
Dim firstUseList As Dictionary(Of String, String) = New Dictionary(Of String, String)()
For index = 1 To doc.Sheets.Count
    For Each balloon As Balloon In doc.Sheets.Item(index).Balloons
        Dim bomRow As DrawingBOMRow = balloon.BalloonValueSets.Item(1).ReferencedRow
        Dim itemNr As String = bomRow.BOMRow.ItemNumber

        If (firstUseList.ContainsKey(itemNr) = False) Then
            Dim baloondata As String = "SHT. " & index
            baloondata = baloondata & ": " & Math.Round(balloon.Position.X * 10, 0)
            baloondata = baloondata & "," & Math.Round(balloon.Position.Y * 10, 0)
            firstUseList.Add(itemNr, baloondata)
        End If
    Next
Next

' search in partslist for the columns with item numbers and the 'First use' column.
Dim firstUsedColumnNr As Integer = -1
Dim itemNrColumn As Integer = -1
For i = 1 To partsList.PartsListColumns.Count
    If (partsList.PartsListColumns.Item(i).Title.Equals(COLUMNNAME)) Then
        firstUsedColumnNr = i
    End If
    If (partsList.PartsListColumns.Item(i).PropertyType = PropertyTypeEnum.kItemPartsListProperty) Then
        itemNrColumn = i
    End If
Next
' if the 'First use' column does not exists then cerate it
If (firstUsedColumnNr = -1) Then
    firstUsedColumnNr = partsList.PartsListColumns.Count + 1
	Dim oPropSet As PropertySet = doc.PropertySets.Item("Inventor User Defined Properties")
	Dim id As String = oPropSet.InternalName
    partsList.PartsListColumns.Add(PropertyTypeEnum.kCustomProperty, id, COLUMNNAME)
End If

' add the collected data to the 'First use' column
For index = 1 To partsList.PartsListRows.Count
    Dim partsListRow As PartsListRow = partsList.PartsListRows.Item(index)

    Dim itemNrCell As PartsListCell = partsListRow.Item(itemNrColumn)
    If (firstUseList.ContainsKey(itemNrCell.Value)) Then
        Dim firstUseCell As PartsListCell = partsListRow.Item(firstUsedColumnNr)
        firstUseCell.Static = True
        firstUseCell.Value = firstUseList(itemNrCell.Value)
    End If
Next

copy past this in a rule and excute it when the sheet with the partslist is active. I was not able to get the "position square" of the ballon but i was able to get the coordinates (x,y)

 

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 3 of 3

Anonymous
Not applicable

Thank you very much for your reply. i am going to try this script this weekend from home and am very excited as this would save an enormous amount of manual editing. Again thank you very much and I will let you know my outcome.

0 Likes