Message 1 of 13
Custom Browser Node
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I would like to add a custom node under the Top Node in the Model Pane in the part environment.
Currently I have the following code which produces an error Method 'AddChild' of object 'BrowserNode' failed
Sub test() Dim BrowserPanes As BrowserPanes Dim BrowserNodeDefinition As BrowserNodeDefinition Dim BrowserNode As BrowserNode Dim Icon As IPictureDisp Dim ClientNodeResource As ClientNodeResource Dim ClientNodeResources As ClientNodeResources Set BrowserPanes = ThisApplication.ActiveDocument.BrowserPanes Set ClientNodeResources = BrowserPanes.ClientNodeResources Set Icon = LoadPicture("c:\testimage.bmp") Set ClientNodeResource = ClientNodeResources.ItemById("TestResource", 1) If (ClientNodeResource Is Nothing) Then Set ClientNodeResource = ClientNodeResources.Add("TestResource", 1, Icon) End If Set BrowserNodeDefinition = BrowserPanes.CreateBrowserNodeDefinition("TestNodeDefinition", 1000, ClientNodeResource) Set BrowserNode = BrowserPanes.Item("Model").TopNode.AddChild(BrowserNodeDefinition) End Sub
The idea is to create a custom node, when clicked will run some code as yet have not looked at.
Does anyone have any idea why this is failing?
I am running Inventor 2012 32bit.
Many thanks