Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
C-Hoppen
591 Views, 4 Replies

How to update document assets from library?

Hello,

this always crashes

 

 

Inventor.PartDocument partDocument = (Inventor.PartDocument)refDocument;
List<Inventor.Asset> updateList = new List<Inventor.Asset>();
foreach (Inventor.MaterialAsset materialAsset in partDocument.MaterialAssets)
{
	try
	{
		updateList.Add(oApp.ActiveMaterialLibrary.MaterialAssets[materialAsset.DisplayName]);
	}
	catch { }
}

foreach (Inventor.Asset asset in updateList)
	try
	{
		asset.CopyTo(partDocument, ReplaceExisting: true); // <---- THROWS AN EXCEPTION
	}
	catch { }

 

 

 What could be the reason for this problem?

Thanks,

Chris