Accessing specific clash test object to find object's specific properties

Shawn_TangV624J
Observer

Accessing specific clash test object to find object's specific properties

Shawn_TangV624J
Observer
Observer

Hi there,

 

I'm working on a Navisworks plugin to access particular object properties by first locating it within the clash test object. If I am able to locate the properties directly within the clash test object that would be best, but if that is not possible then I would like to identify any keys/ids that are located within the Clash test class to retrieve the object outside of the clash test class. 

 

Below are a few examples of keys/ids that I believe may be used to identify the particular object:

GUID:

Shawn_TangV624J_0-1686265197419.png

Id:

Shawn_TangV624J_2-1686265283179.png

Here is my attempt to find any unique key/id which links the objects in a clash to its properties outside of the clash class.

Shawn_TangV624J_3-1686265513034.png

Thanks,

Shawn

 

0 Likes
Reply
417 Views
3 Replies
Replies (3)

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @Shawn_TangV624J ,


Please be aware that the Navisworks API hardly ever supports any functionality that is not also available in the user interface.

 

Therefore, if the UI does not support this, the API will probably not do so either.

 

So, it will always help to research the optimal manual approach to a solution first, before attacking the task programmatically.

 

Your solution looks good to me.(i.e) Clash>>access SelectionA>>ModelItems>>Properties>>Guid

 

I am not aware of any other ways/methods.

 

If this is not what you want, Could you please explain your issue in detail?


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes

Shawn_TangV624J
Observer
Observer

It seems that the instanceguid can be used to find the particular object in the clash, but how can I then use this instanceguid or anything else access the properties of the particular object? Such as Type, Geometry, Material:Shawn_TangV624J_0-1686603094046.png

 

For example, one way to find the identifier of a particular object (not in a clash) could be ActiveDocument -> CurrentSelection -> Value -> Explicit Selection -> First -> PropertyCategories -> Id, but how can this be related back to the objects within the clash test?

 

The purpose of this is that I would like to be able to group objects within clash tests based on their properties.

 

Thanks,

Shawn

 

0 Likes

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @Shawn_TangV624J ,

 

As far as I understood, let's say we have a clash "Clash A". From "Clash A", we can access model items via Selection A and Selection B.

 

Let's say Selection A contains an model item(item1) and selection B contains an model item(item2).

You want to group item1 and item 2. Is my understanding correct?

 

My question to you is where do you want to group the items? My suggestion is you can create a modelitemcollection ,add item1 and item2 to the modelitemcollection and save it as selection set

 

Now the question is how to access and get item1 and item2?

 

I would suggest the below steps

 

1. Access Selection A in clash.
2. Get ModelItem from selection A
3. Access Id/Guid of ModelItem(Properties)
4. Now use Search API and access the ModelItem
5. Search API will return a model item collection. Let's call it collection1.
6. Now follow the same steps for selection B.
7. Search API will return a model item collection. Let's call it collection2.
8. Now you can combine the collection or create your own collection of model items.
9. Now save the collection as selection set

 

Please take a look at these below links
https://apidocs.co/apps/navisworks/2018/87317537-2911-4c08-b492-6496c82b3edb.htm 
https://forums.autodesk.com/t5/navisworks-api/level-elevation/td-p/12027450 
https://adndevblog.typepad.com/aec/2012/08/add-search-selectionset-in-net.html 


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network