Unable to get ContentTreeViewNode by API

Unable to get ContentTreeViewNode by API

Anonymous
Not applicable
688 Views
2 Replies
Message 1 of 3

Unable to get ContentTreeViewNode by API

Anonymous
Not applicable

I am struggling to get the ContentTreeViewNode object filled correctly. I set Category="Fasteners"

 

Public Class SearchCC
#Region "Properties"
    Dim IU As New InventorUtils
    Private _PartNames As New Collection
    Private _tvNodeTop As ContentTreeViewNode = Nothing
...
...     'top of tree view to start searching in Content Center     Private _TopNodeName As String = ""     Public Property TopNodeName() As String         Get             Return _TopNodeName         End Get         Set(ByVal value As String)             _TopNodeName = value         End Set     End Property     Private _Category As String = ""     Public Property Category As String         Get             Return _Category         End Get         Set(ByVal value As String)             _Category = value             If value <> "" Then                 _tvNodeTop = IU.CC.TreeViewTopNode.ChildNodes.Item(_Category) <---- line 45             End If         End Set     End Property

 

============================================

 I receive the following error:

 

System.Runtime.InteropServices.COMException was unhandled
  ErrorCode=-2147467259
  HResult=-2147467259


  Message=Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
  Source=""
  StackTrace:


       at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
       at Inventor.ContentCenter.get_TreeViewTopNode()
       at OpenVault_CopyCC.SearchCC.set_Category(String value) in C:\vb\Parker.Weers.CAD.OpenVault_CopyCC\OpenVault_CopyCC\OpenVault_CopyCC\Class\SearchCC.vb:line 45
       at OpenVault_CopyCC.Module1.Main() in C:\vb\Parker.Weers.CAD.OpenVault_CopyCC\OpenVault_CopyCC\OpenVault_CopyCC\Module1.vb:line 11
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, S

tring[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:

 

============================================

 

All examples I can find forward a string as category name, so what am I overlooking here?

 

Best regards,

Maarten Weers

0 Likes
689 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

I discovered I was able to run the code, in debug mode in VS,  after a full restart of windows. The code ran for several categories and then suddenly halted on the same line with the same error code.

 

Can there be some kind of overflow of data here? The scan starts from level one ( for example 'fasteners') which runs ok. But when 'fasteners' and  'Tube & Pipe' are done sequential in one run the error pops up again.

 

Best regards,

Maarten Weers

 

0 Likes
Message 3 of 3

adam.nagy
Autodesk Support
Autodesk Support

Hi Maarten,

 

This seems similar to this issue:

https://forums.autodesk.com/t5/inventor-customization/change-size-content-center/m-p/6008127#M61228

Logged as INVGEN-3678

 

I made a note in the log that you ran into it as well.

Hope that will raise the priority.

 

Cheers,

 



Adam Nagy
Autodesk Platform Services
0 Likes