Message 1 of 24
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello All,
I am experiencing an out-of-memory error while working with Topology Tagging APIs on Inventor 2020.3.4.
The Assembly is loaded in "Load Full" mode since the "Express Mode" does not give access to the Topology/B-Rep information.
I am getting this issue while trying to collect the B-rep topology using ReferenceKey and ReferenceKeyContext APIs for each Face and Edge in the Assembly using the C# .Net external application. I need this topology persistent id information to bind back this data in a disconnected Inventor Add-In application.
The system has 16 GB RAM and we did check the GDI limit as well.
We found the memory to exhaust at ~33,000 keys.
We are working with one ReferenceKeyManager and Multiple Key Context Tables
Please see the image below from the Task Manager showing the GDI count and Memory consumed while running the application. It is at this exact moment that the out of memory error is being thrown and Inventor crashes
A piece of the code implementation is also attached
[TestMethod]
public void ReferenceKeyApi()
{
// Get Inventor App
InventorApp = (Inventor.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Inventor.Application");
VctApplication.InventorApp = InventorApp;
Document document = VctApplication.InventorSession.ActiveDoc;
SelectSet selectSet = document.SelectSet;
dynamic selectedObject = null;
if (selectSet.Count > 0)
selectedObject = selectSet[1];
// Initialize the VctDocument class
VctDocument vctDocument = VctApplication.InventorSession.VctDocument;
// Example for an assembly document
switch (selectedObject)
{
case FaceProxy faceProxy:
faceProxy = (FaceProxy) selectedObject;
// To get reference key and key context
string fKey = vctDocument.GetReferenceKey(document, faceProxy, out string fKeyContext);
selectSet.Clear();
// later to bind back the reference key to the entity using the key context
FaceProxy fRetrievedObject = vctDocument.GetEntityFromReferenceKey(document, fKey, fKeyContext);
selectSet.Select(fRetrievedObject);
break;
case EdgeProxy edgeProxy:
edgeProxy = (EdgeProxy) selectedObject;
// To get reference key and key context
string eKey = vctDocument.GetReferenceKey(document, edgeProxy, out string eKeyContext);
selectSet.Clear();
// later to bind back the reference key to the entity using the key context
EdgeProxy eRetrievedObject = vctDocument.GetEntityFromReferenceKey(document, eKey, eKeyContext);
selectSet.Select(eRetrievedObject);
break;
}
}
Thanks,
Amitabh Mukherjee
Solved! Go to Solution.