There are two ways to traverse upwards in a structure using the Extensions API.


Current Node Path

The first is by calling host.GetCurrentNodePath(). The Host object is in the IswItemViewContent class in the SetHost() method. Using this, you can see the parts in the tree and find your way to the item of interest. This way is applicable when users will only be working within the currently shown structure tree. 


All References

The second way is by using item.GetAllReferences(). An item that you select in a tree may be included in multiple structure trees. So, what you can do is to return a list of all structures that the item is a part of (in the form of a drop-down list). Then, the user can select which structure they are interested in.


Here is an example of calling GetAllReferences() and returning a list of references that points to the item through a path of part types defined by part SIDs:


public IswItems FindParameters(IswItem item)
{
    if (item == null)
        return _host.GetBroker().Lists.NewItemList();

    return item.GetAllReferences("SID;PATH");
}


Example