06-07-2016
07:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
06-07-2016
07:36 AM
vb.net program keeps catching on sub-routine
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
06-21-2016
02:51 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
06-21-2016
02:51 PM
Hi,
You would need to add logging or something to your code in order to be able to track what's going on inside the iLogic part too:
http://adndevblog.typepad.com/manufacturing/2014/08/debug-ilogic.html
Cheers,

Adam Nagy
Autodesk Platform Services