Message 1 of 5
How to update document assets from library?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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