Announcements
Autodesk Community will be read-only between April 26 and April 27 as we complete essential maintenance. We will remove this banner once completed. Thanks for your understanding

Level Elevation

preeti.kumari9TBN6
Enthusiast

Level Elevation

preeti.kumari9TBN6
Enthusiast
Enthusiast

How to get the elevation of the level in Navis Api?

0 Likes
Reply
537 Views
4 Replies
Replies (4)

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @preeti.kumari9TBN6 ,

 

Could you please explain your issue with screenshots?


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @preeti.kumari9TBN6 ,

 

If you are looking for a way to access Level property of an element via Navisworks API, then I would suggest you use the search API.

 

https://apidocs.co/apps/navisworks/2018/T_Autodesk_Navisworks_Api_Search.htm 

 

https://apidocs.co/apps/navisworks/2017/87317537-2911-4c08-b492-6496c82b3edd.htm 

 

https://twentytwo.space/2020/05/28/navisworks-api-search-modelitem-and-collect-properties/ 


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes

preeti.kumari9TBN6
Enthusiast
Enthusiast

Hey @Anonymous, Thank you for your response. Actually, I am not looking for the level property. My concern is how to get the elevation of a particular level. Basically, I wanted to create a bounding box from level to level(such as from level1 to level2) . This bounding box, I wanted to created a viewpoint accordingly. Hope, I make you understand my concern.

 

 

0 Likes

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @preeti.kumari9TBN6 ,

 

I created a simple Furniture elements in Revit.

 

I placed one furnitue in Level 0 and another one in Level 1 and exported the file to nwc.

 

I can see the level property category.From the property category, I can get the Elevation data property. Please see the attached images.

 

My Suggestion to you is
1)Get an element with category "Level" via search API
2)From "Level" property category, access the "elevation" data property and get it's value.

 

I think search API will help you to achieve what you want.

 

Here is the sample code

private void SimpleCode(Document doc)
        {
            string itemAndElevation = "";

            Search search = new Search();
            search.SearchConditions.Add(SearchCondition.HasCategoryByDisplayName("Level"));
            search.Selection.SelectAll();

            ModelItemCollection collection = search.FindAll(doc, true);
            foreach(ModelItem item in collection)
            {
                DataProperty dataProperty=item.PropertyCategories.FindPropertyByDisplayName("Level", "Elevation");
                string elevationValue = dataProperty.Value.ToString();
                itemAndElevation = itemAndElevation + "\n" + item.DisplayName + " -- " + elevationValue;
            }
            MessageBox.Show(itemAndElevation);
        }

You can then access the "elevationValue" and create your bounding box.


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network