Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am getting this error while trying to get Display Name of category on some objects in a file.
Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Repeat 2 times:
--------------------------------
at <Module>.LcOpPropertyNode.GetAttribClassUserNameFast(LcOpPropertyNode*, Int32, LcUWideStringBuffer*)
--------------------------------
at Autodesk.Navisworks.Api.PropertyCategoryCollection.GetAttribClassUserName(Int32, System.String ByRef)
at Autodesk.Navisworks.Api.PropertyCategory.get_DisplayName()
at CleanDups.navisInjectService.deletecheck(Autodesk.Navisworks.Api.PropertyCategory, Autodesk.Navisworks.Api.ModelItem, System.String)
at CleanDups.navisInjectService.injectAttributes()
at CleanDups.Program.Main(System.String[])
the full program stop working when it hit that error and i can't catch it to skip or do anything when it happen.
my Code part
foreach (PropertyCategory oPC in modelItem.PropertyCategories)
{
CatName = oPC.DisplayName;
}
is there another way to get the display name using Managed code or COMAPI?
Solved! Go to Solution.