Message 1 of 2
vb.net program keeps catching on sub-routine
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm using vb.net to create a configurator for Inventor. While creating the program it was running well until a few weeks ago when it started hanging up on a certain function. It is just changing a text parameter in a sub-component of an assembly. The component does have some iLogic in it as well (it uses an embedded spreadsheet to look up dimension parameters). I'm wondering if anyone out there has any idea why this might be happening and how to fix it. Thanks in advance! Here is the sub:
Public Sub ChgPrtTxtParam(componentName As String, paramName As String, setValue As String) Try Dim asmDoc As AssemblyDocument asmDoc = oInventorApp.ActiveDocument Dim oOccs As ComponentOccurrences oOccs = asmDoc.ComponentDefinition.Occurrences Dim oOcc As ComponentOccurrence If setValue = Nothing Then setValue = "" Exit Sub End If oOcc = oOccs.ItemByName(componentName) Dim oPartDef As PartComponentDefinition oPartDef = oOcc.Definition If oPartDef.Parameters.Item(paramName).Value <> setValue Then oPartDef.Parameters.Item(paramName).Value = setValue End If Catch ex As Exception MsgBox(ex.Message & " - Error: ChgPrtTxtParam component: " & componentName & ", parameter: " & paramName) End Try End Sub