Wait till user select iPartmember from table

Wait till user select iPartmember from table

Anonymous
Not applicable
294 Views
0 Replies
Message 1 of 1

Wait till user select iPartmember from table

Anonymous
Not applicable

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

 

0 Likes
295 Views
0 Replies
Replies (0)