Message 1 of 2
Rule/ilogic giving Error after 2016 Hotfix/Update

Not applicable
03-13-2017
08:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So, I had this code for our Engineering group to use to automatically label our flat patterns & parts with Part#/Material/QTY. It has always worked fine with absolutely zero issues. Came in this morning, and I assume the hotfix/update was applied as it was no longer on my "Updates" list, and now I am getting the following error.
Here is the Code
Any Help with this would be greatly Appreciated!
SyntaxEditor Code Snippet
' Set a reference to the drawing document.' This assumes a drawing document is active. Dim oDrawDoc As DrawingDocument oDrawDoc = ThisApplication.ActiveDocument Dim oSheets As Sheets Dim Sheet As Inventor.Sheet Dim oViews As DrawingViews Dim oView As DrawingView For Each oSheet In oDrawDoc.Sheets 'For Each oSheet In oSheets oViews = oSheet.DrawingViews For Each oView In oViews 'Get the full filename Of the view model Dim oModelFileName As String oModelFileName = oView.ReferencedDocumentDescriptor.ReferencedDocument.FullFileName 'MessageBox.Show("view model name" & oModelFileName, "Title") Dim oPartList As PartsList 'try and get the parts list form the table of this sheet Try oPartList = oDrawDoc.ActiveSheet.PartsLists.Item(1) Catch 'on error try and search all sheets for first found parts list'iterate trough each sheet Dim i As Long For i = 1 To oDrawDoc.Sheets.Count If oDrawDoc.Sheets.Item(i).PartsLists.Count > 0 Then Exit For Next oPartList = oDrawDoc.Sheets.Item(i).PartsLists.Item(1) 'MessageBox.Show("parts list found on: " & i, "Title") End Try ' Iterate through the contents of the parts list. Dim j As Long For j = 1 To oPartList.PartsListRows.Count ' Get the current row. Dim oRow As PartsListRow oRow = oPartList.PartsListRows.Item(j) 'get filename of model in row Dim oRowFileName As String oRowFileName = oRow.ReferencedFiles.Item(1).FullFileName 'compare the filenames'Performs a text comparison, based on a case-insensitive text sort order'If strings equal returns 0 If StrComp(oModelFileName, oRowFileName, CompareMethod.Text)=0 Then 'Get the value of Item from the Parts List Title = iProperties.Value("Summary", "Title") 'Row name needs to be case sensitive or use 1 for first 2 for second etc. oCell = oPartList.PartsListRows.Item(j).Item("Part Number") 'Row name needs to be case sensitive or use 1 for first 2 for second etc.'get the value of text in cell Dim oItemValue As String oItemValue = oCell.Value 'Row name needs to be case sensitive or use 1 for first 2 for second etc. oCell = oPartList.PartsListRows.Item(j).Item("Material") 'Row name needs to be case sensitive or use 1 for first 2 for second etc.'get the value of text in cell Dim oItemMaterial As String oItemMaterial = oCell.Value 'Row name needs to be case sensitive or use 1 for first 2 for second etc. oCell = oPartList.PartsListRows.Item(j).Item("QTY") 'Row name needs to be case sensitive or use 1 for first 2 for second etc. Dim oItemQTY As String oItemQTY = oCell.Value 'Show the view label oView.ShowLabel = True '0.32 = .125" 0.305 = .12" i.e. .125 x 2.56 = 0.32 take font size you are used to and multiply it by 2.56 to get your iLogic font size"'format the text first line oStringName = "<StyleOverride Bold='True' FontSize='0.32'>" & Title &"-"& oItemValue &" </StyleOverride>" 'format the text second line oStringMaterial = "<Br/><StyleOverride FontSize='0.305'>"& oItemMaterial &" </StyleOverride>" 'format the text third line oStringItem = "<Br/><StyleOverride FontSize='0.305'>"& " QTY: " & oItemQTY &" </StyleOverride>" 'add to the view label oView.Label.FormattedText = oStringName & oStringMaterial & oStringItem End If Next Next Next