Tech Tip: Add Property Data to Aras Structure Browser

Tech Tip: Add Property Data to Aras Structure Browser

The Aras Structure Browser is a useful feature that allows users to view all items related to the selected context item. It's a great way to get a "big picture" view of your data structure, without getting overwhelmed with every item's property data. However, sometimes it can be helpful to selectively display additional details in the Structure Browser. In this post we'll look at a couple ways to supplement the default Structure Browser item data.

Getting Started

We'll be using some code from the Override Default Structure Browser project on the Aras Labs GitHub page. You can clone or download the project and install it according to the instructions on the project page.

ArasLabs/override-default-structure-browser

override-default-structure-browser - Sample code for customizing the Aras structure browser.

This article only covers Case 2 "Add Property for Context ItemType" and Case 3 "Add Property for Specified ItemTypes" from the Override Default Structure Browser project, but Case 4 "Filter Relationships" and Case 5 "Customize Images Loaded" apply the same techniques.

Case 1 is just the Default Structure Browser, which can be used for diffing changes or rolling back code updates.

1. Add a Property to One ItemType

Display the classification property for Part items

Display the classification property for Part items

In this example, we will be adding the classification property to the context item and all items of the same type. As you can see in the screenshot above, the selected Part and all of its related Part items include their classification values. The other ItemTypes - CAD Document, Document, and Requirement do not display classification values.

The following C# method code is an excerpt from the customized GetItemsForStructureBrowser method import. You can find the complete package in the Override Default Structure Browser project: 2 - Add Property For Context Item.

2. Add a Property to Multiple ItemTypes

Show a property for multiple ItemTypes in the Aras Structure Browser

Show a property for multiple ItemTypes

Now that we've seen how to override the default StructureBrowser object with our own CustomStructureBrowser class, we can use the same technique to implement other configurations. For example, users may want to see classification data for more ItemTypes, not just the context ItemType.

In the code below, we define a HashSet that contains the names of the ItemTypes we want to customize. Then we can simply loop through the HashSet and add a StructureItem for each ItemType when we build our CustomStructureBrowser object. (See lines 14-18 in the method code)

You can find the complete package in the Override Default Structure Browser project: 3- Add Property For Context Item.

Looking For More Tech Tips?

Subscribe to our blog and follow @ArasLabs on Twitter for more helpful content! You can also find our latest open-source projects and sample code on the Aras Labs GitHub page.