Community
Navisworks API
Welcome to Autodesk’s Navisworks API Forums. Share your knowledge, ask questions, and explore popular Navisworks API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Navisworks Error - Unspecific while getting InwGUIAttribute.ClassUserName

1 REPLY 1
SOLVED
Reply
Message 1 of 2
alexandrescoelho
639 Views, 1 Reply

Navisworks Error - Unspecific while getting InwGUIAttribute.ClassUserName

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 + "']");
}
1 REPLY 1
Message 2 of 2

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.

Post to forums  

Rail Community


 

Autodesk Design & Make Report