ContentCenter edit through InventorServer

ContentCenter edit through InventorServer

m_baczewski
Advocate Advocate
140 Views
1 Reply
Message 1 of 2

ContentCenter edit through InventorServer

m_baczewski
Advocate
Advocate

Hi, I have a problem. I'm trying to integrate Content Center with an ERP system. I wasn't sure if I could edit the Content Center database from the application level. I managed to do it by writing this test code:

 

Dim oInvApp As Inventor.Application = ThisApplication 

Dim oContentKsztal As ContentTreeViewNode
Dim oContentProfile As ContentTreeViewNode


For Each oContentTree As ContentTreeViewNode In oInvApp.ContentCenter.TreeViewTopNode.ChildNodes
	If oContentTree.DisplayName = "Kształtowniki konstrukcyjne"
		oContentKsztal = oContentTree
	End If
Next

For Each item1 As ContentTreeViewNode In oContentKsztal.ChildNodes
	If item1.DisplayName = "Rury kwadratowe/prostokątne"
		oContentProfile = item1
	End If
Next 

Dim profileStalowe As ContentFamily

For Each item3 As ContentFamily In oContentProfile.Families
	If item3.DisplayName = "KRATKI PROFILE STALOWE S235JRH"
		profileStalowe = item3
	End If
Next

Dim listParam As List(Of String) = New List(Of String) From {"32","54", "4", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "S235JR", "", "", "", "", ""}

profileStalowe.TableRows.Add(listParam.ToArray(),profileStalowe.TableRows.Count+1)
profileStalowe.Save

 

 

When I try to transfer this to Vault as a job processor task, where I'm using Inventor.Server, I unfortunately get an unspecified error. I cant define ContentCenter object. 

 

 private void mTestMethod(IJobProcessorServices context, IJob job)
        {
            InventorServerObject mInv = context.InventorObject as InventorServerObject;
            DesignProject designProject = mInv.DesignProjectManager.DesignProjects.AddExisting("C:\\xxxx\\xxx.ipj");
            designProject.Activate();

            ContentCenter CC = mInv.ContentCenter; // <--- error 

 Has anyone ever encountered this problem or knows how to approach it?

0 Likes
141 Views
1 Reply
Reply (1)
Message 2 of 2

m_baczewski
Advocate
Advocate

The error looks like this:

mInv.ContentCenter = mInv.ContentCenter: a System.Runtime.InteropServices.COMException is thrown.

m_baczewski_0-1728369870617.png

 

 

And

 

m_baczewski_1-1728369870687.png

 

It looks like it can't find some libraries. Has anyone encountered this issue?

0 Likes