Rule/ilogic giving Error after 2016 Hotfix/Update

Rule/ilogic giving Error after 2016 Hotfix/Update

Anonymous
Not applicable
286 Views
1 Reply
Message 1 of 2

Rule/ilogic giving Error after 2016 Hotfix/Update

Anonymous
Not applicable

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.

Captureerror.PNG

CaptureError2.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

 

0 Likes
287 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

On another assembly I am also getting this error which did not happen on Friday, So the update has changed something.

 

 

System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Inventor.PartsListRow.get_Item(Object Index)
at LmiRuleScript.Main()
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)

0 Likes