- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
All,
Good morning! I've ventured into the exciting world of iLogic once again and have a question on accessing the BOM Qty columns of a Parts List. I believe the entity that I'm looking for is the 'kBOMQuantityObject', but I'm not sure. I've been able to identify the "QTY" columns in the Parts List, but I'm using text string comparisons to get there. It works, but I'm missing the "Base Qty", "Item Qty" and "Unit Qty" for some reason...
Ultimately my goal is to replace 0 quantity items with a "-", but don't want to do that for every potential column, just for quantity columns, so I'm leery about setting every 0 value to a "-". This is why I'm searching for a reliable way to isolate the quantity columns.
I've made a video to help illustrate this as well. Much thanks to @Anonymous for the code to cycle through the Parts List rows and columns.
'Define the necessary objects Dim oDrawDoc As DrawingDocument = ThisDoc.Document Dim oSheet As Sheet = oDrawDoc.ActiveSheet Dim oPartsList As PartsList = oSheet.PartsLists.Item(1) Dim oPLColumn As PartsListColumn Dim oPLRow As PartsListRow Dim oPLCell As PartsListCell 'iterate through each row of the parts list For i = 1 To oPartsList.PartsListRows.Count oPLRow = oPartsList.PartsListRows.Item(i) 'look at each column in the row For j = 1 To oPartsList.PartsListColumns.Count oPLColumn = oPartsList.PartsListColumns.Item(j) oPLCell = oPLRow.Item(j) 'Check to see if the column title contains the letters "qty", "True" indicates the case doesn't matter If String.Compare(Left(oPLColumn.Title, 3), "qty", True) = 0 Or String.Compare(Mid(oPLColumn.Title, 5, 3), "qty", True) = 0 Then ' If oPLCell.Type = kBOMQuantityObject Then 'Check to see if the cell has not been overriden and is set to 0, if so, replace the value with a "-" Try If oPLCell.Static = False And oPLCell.Value = 0 Then oPLCell.Value = "-" Else If oPLCell.Static = True Temp_Val = oPLCell.Value oPLCell.Static = False If oPLCell.Value = 0 Then oPLCell.Value = "-" Else oPLCell.Value = Temp_Val End If End If Catch End Try End If Next Next iLogicVb.UpdateWhenDone = True
Please give a kudos if helpful and mark as a solution if somehow I got it right.
Solved! Go to Solution.