Hello everybody
Sorry if this forum is not the right place to post this issue. If it's not please let me know
I'm getting properties from categories with this piece of code (see below). But sometimes I get this erro <<Navisworks Error - Unspecific>> at Autodesk.Navisworks.Api.Interop.ComApi.InwGUIAttribute.get_Class UserName(). It's completely intermittent, sometimes occurs this error sometimes not. Anyone have seen this error before?
var e = propn.GUIAttributes().GetEnumerator(); while (e.MoveNext()) { InwGUIAttribute x = e.Current as InwGUIAttribute; propertiesNode = elementNode.SelectSingleNode("properties[@name='" + x.ClassUserName + "']");
}
Solved! Go to Solution.
Solved by alexandrescoelho. Go to Solution.
Well, it seems nobody but me have faced this issue.
To avoid this error I made some changes in my code.
First I made a cast to get GUIAttributes as IEnumerable then I get the attribute with ClassUserName value that I want using linq.
Doing like this I don't need to iterate over collection to find a specific attribute by testing ClassUserName value (where the error occurs)
var attributes = propn.GUIAttributes().Cast<InwGUIAttribute>();
InwGUIAttribute attribute = attributes.FirstOrDefault(x => x.ClassUserName == 'Item');
Can't find what you're looking for? Ask the community or share your knowledge.