Wait till user select iPartmember from table

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I've a program in vb.net which makes a new assembly and then inserts an iPart.
then i want the user to select a iPartmember from the iParttable.
The program must wait till user has select a member and then i do some other things.
So i tried to get the table through its browsernode and call the "AssemblyChangeComponentCmd"
Now the problem is that the browserpane isn't updated so i can't set a reference to the table.
Why is that?
I tried it with this snipset of code with no succes:
'Insert occurence in new created assembly
Dim oOcc As Inventor.ComponentOccurrence
oOcc = oAsmCompDef.Occurrences.Add(strFileName, oMatrix)
'I tried this to update the browserpane with no succes
oAsmDoc = m_inventorApplication.ActiveDocument
oAsmDoc.Update()
oAsmDoc.SelectSet.Clear()
Dim oBrowserPaneObject As Inventor.BrowserPaneObject = oAsmDoc.BrowserPanes.ActivePane
oBrowserPaneObject.Update()
oNode = GetBrowserNodeFromObject(oAsmDoc, oOcc)
'-> There is no node to get at this moment because browserpane isn't updated yet, but there is already a occurence inserted
'Why isn't the browserpane updated????
oNode.Expanded = true
oTableNode = oNode.BrowserNodes.Item("Table")
oTableNode.DoSelect()
oControlDef = m_inventorApplication.CommandManager.ControlDefinitions.Item("AssemblyChangeComponentCmd")
oControlDef.Execute()
'Wait till user has made a selection
Do While m_inventorApplication.CommandManager.ActiveCommand = "AssemblyChangeComponentCmd"
System.Windows.Forms.Application.DoEvents()
Loop