GUI propertys and looping trough the model

GUI propertys and looping trough the model

jim.marstboomB87K6
Explorer Explorer
476 Views
4 Replies
Message 1 of 5

GUI propertys and looping trough the model

jim.marstboomB87K6
Explorer
Explorer

Hello,

 

I am using COM API and I want to readout a specific GUIAtribute of all the Items in the model, and if I encounter a specific Attribute I want to Add a hyperlink to that Item.

 

I can loop trough the model and get all the Items, but this leaves met with inwOaNodes.

 

I can read GUIAtributes from a inwOaPath.

 

But there does not seem to be a way to convert a inwOaNode to a inwOaPath (https://forums.autodesk.com/t5/navisworks-api/inwoanode-to-inwoapath-in-com-api/td-p/9311914)

 

Is there another way to loop thought he model and get a list of inwOaPaths?

 

Thanks in advance.

 

Jim

0 Likes
Accepted solutions (1)
477 Views
4 Replies
Replies (4)
Message 2 of 5

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @jim.marstboomB87K6 ,

 

Could you please take a look at the below link?

https://adndevblog.typepad.com/aec/2012/08/addmodifyremove-custom-attribute-using-com-api.html 

 


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 5

jim.marstboomB87K6
Explorer
Explorer

Reading and setting the atributes is not the problem. I have trouble looping trough all the path's of the model

 

 

0 Likes
Message 4 of 5

naveen.kumar.t
Autodesk Support
Autodesk Support
Accepted solution

Hi @jim.marstboomB87K6 ,

 

I don't exactly understand your issue.

Here is the sample code

Document doc = Autodesk.Navisworks.Api.Application.ActiveDocument;
ModelItemEnumerableCollection mycollection = doc.Models.RootItemDescendantsAndSelf;
doc.CurrentSelection.AddRange(mycollection);
InwOpState10 state = ComApiBridge.State;         
InwSelectionPathsColl opaths = state.CurrentSelection.Paths();
foreach(InwOaPath path in opaths)
   {
     //Access each InwOaPath
   }

If this doesn't help, please explain your issue in detail.


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 5 of 5

jim.marstboomB87K6
Explorer
Explorer

I was using only COM API and not the .NET API.

 

Your example suggests to combining both API's. I will look further into this and do some more testing.

 

Thanks for tip.

 

Jim

0 Likes