Back to contents pageHow to get the available areas using the API

How to get the available areas using the API

Summary

This article shows how to get the available areas using the Ubisense .NET API.



Prerequisites

You should know the information in the following article:



Example material

Save this link to get a zip file of the example material


Guide

Before you start, remember to:

The Ubisense.UBuilding.Contents.AreaProperties relation contains the basic properties of an area.

You can iterate over this relation using the area_ or name_ methods that return unique indices. For example,


    using (Ubisense.UBuilding.Contents.ReadTransaction xact =
        build_contents_schema.ReadTransaction())
    {
        foreach (Ubisense.UBuilding.Contents.AreaProperties.RowType row in
            Ubisense.UBuilding.Contents.AreaProperties.name_(xact))
        {
            // row.area_ contains the area in question

            // row.description_ contains a human-readable description of the area

            // row.extent_ contains a right-polygonal prism
            //            describing the extent of the area

            // row.name_ contains the human-readable name of the area
        }
    }

Note that the cache query method outlined above is preferable to using the remote procedure calls outlined below. This is because querying a local cache gives predictable scalability.


Alternatively, you can use the get_area method or the get_all_areas method of your build_contents_schema instance. For example, use get_all_areas as follows,


    List<Ubisense.UBuilding.Contents.AreaProperties.RowType> area_list;
    build_contents_schema.get_all_areas(out area_list);

area_list now contains a list of all the rows in the Ubisense.UBuilding.Contents.AreaProperties relation.



Back to top