Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
When I try to add a Workpointnode to a existing Browserfolder an error occurs.
When I do the same with a part it works.
How can I add a Workpoint to a given Browserfolder.
You can see it with the following example:
1. Open an new assembly
2. Insert a Browserfolder "NewFolder"
3. Insert a Part
4. Insert a Workpoint
5. run the following code
Sub AddtoBrowserFolder() ' Ref to AssebmlyDocument Dim oAssmDoc As AssemblyDocument Set oAssmDoc = ThisApplication.ActiveDocument ' Ref to activePane Dim oPane As BrowserPane Set oPane = oAssmDoc.BrowserPanes.ActivePane 'Ref to Folder 'NewFolder' Dim oFolder As BrowserFolder Set oFolder = oPane.TopNode.BrowserFolders("NewFolder") 'ref to secondlast nod(Part) Dim oBrowserNode As BrowserNode Set oBrowserNode = oPane.TopNode.BrowserNodes.Item(oPane.TopNode.BrowserNodes.Count - 1) Debug.Print oBrowserNode.FullPath Call oFolder.Add(oBrowserNode) oPane.Refresh MsgBox "no error" 'ref to last node (Workpoint) Set oBrowserNode = oPane.TopNode.BrowserNodes.Item(oPane.TopNode.BrowserNodes.Count) Debug.Print oBrowserNode.FullPath Call oFolder.Add(oBrowserNode) End Sub
What is wrong?
Best Regards
Wolfgang
Solved! Go to Solution.