## Querying Wall Types

 In Revit API, Wall Types are represented by DB.WallType. Walls have three main System Families that are represented by DB.WallKind enumeration and could be determined by checking DB.WallType.Kind. In Rhino.Inside.Revit, the term Wall System Family is used instead for consistency.

Use a combination of Category Filter and Query Types+ v1.0 components to collect all the wall types in a Revit model:

## Querying Walls

 In Revit API, Walls are represented by DB.Wall

### Querying All Walls

Use a combination of Category Filter and Query Elements components to collect all the wall instances in a Revit model:

 Note that Revit API will return the individual partial walls on a Stacked Wall when using this workflow

### By Wall System Family

A better workflow is to collect walls based on the Wall System Family. Use the Wall System Family component to select any combination of the builtin Basic, Stacked, or Curtain walls in Revit. You can then pass this selection as the input to the Query Walls as shown below:

### By Wall Type

You can also collect walls of a specific type very easily using a workflow described in Data Model: Elements & Instances

## Analyzing Wall Types

Once you have filtered out the desired wall type using workflows described above, you can query its parameters and apply new values. See Document Model: Parameters to learn how to edit parameters of an element type.

### Analyzing Basic Walls

Basic Walls are a special Wall System Family in Revit. They are constructed from a set of layers that are defined as part of the wall type definition. The also have a series of other unique options e.g. Wrapping at Inserts. The Analyze Basic Wall Type component shown here provide a method to analyze the Basic Wall types in Revit document:

Some of the outputs on this component (e.g. Wrapping at Inserts and Wrapping at Ends) return an integer value that corresponds to an enumeration in the Revit API. You can use the Wall Wrapping and Wall Function components (shown above in front of the parameter values panel) to determine which value is set on the parameter and filter the source wall types. The examples below show how this component are used to filter the wall types by Wrapping and Function:

### Basic Wall Structure

 In Revit API, DB.CompoundStructure type represents the structure definition of categories that allow such configuration e.g. Basic Walls, Floors, Roofs, Compound Ceilings, etc. The DB.CompoundStructure can provide access to individual layers represented by DB.CompoundStructureLayer

The Analyze Basic Wall Type component shown above, provides access to the Compound Structure definition of the Basic Wall type. Use the Deconstruct Compound Structure component shown here to extract information on Compound Structure Layers. Similar to above, Opening Wrapping Condition and End Cap Condition components are provided to allow value comparison and filtering of the structure layers:

As shown above, layers are ordered from Exterior to Interior, matching the Revit GUI layer ordering. The example below shows a workflow to access individual layers by their index:

### Basic Wall Structure Layers

Use the Deconstruct Compound Structure Layer component to extract information about each individual Compound Structure Layer. Layer Function and Deck Embedding Type components are also provide for value comparison:

### Stacked Wall Structure

 Currently there is no support in Revit API to access Stacked Wall structure data. However you can use the Analyse Stacked Wall component to extract the embedded Basic Wall instances and analyze their structure layers individually

## Analyzing Walls

Once you have filtered out the desired wall instance using workflows described above, you can query its parameters and apply new values. See Document Model: Parameters to learn how to edit parameters of an element.

### Common Wall Properties

Use the Analyze Wall component shown here, to grab the common properties between all Wall System Families. Wall System Family and Wall Structural Usage components are also provided for value comparison:

 Slant Angle property is only supported on Revit >= 2021

The example below uses the shared Wall Structural Usage value list component to filter for Shear walls:

The Orientation output parameter is the wall orientation vector:

### Wall Location Curve

 In Revit API, Location Line of a Basic or Stacked Wall is represented by the DB.WallLocationLine enumeration and is stored in DB.BuiltInParameter.WALL_KEY_REF_PARAM parameter on the wall instance

Basic and Stacked Walls have a concept known as Location Line. The location line defines the vertical reference plane for the wall instance. The wall stays fixed on this vertical reference plane when it is flipped or its structure is modified. The Analyze Wall Location Curve component shown here, can extract information about a wall location line. This component returns the center line curve, location line setting, curve, offset, and offset direction:

Wall Location Line component is also provided to assist in filtering walls by the Location Line value:

If you only need the center line of the wall, an easier and more Grasshopper-like method is to pass the Wall elements to a Curve component:

### Wall Profile

Use the Analyze Wall Profile component shown here to extract the profile curves for a Basic or Stacked Wall element. Note that these profile curves are extracted along the center plane of the wall:

### Wall Geometry

You can use the Element Geometry component to grab the basic geometry of a wall instance:

### Wall Geometry By Structure

 Normally in Revit API, geometry of an element can be extracted using the DB.Element.Geometry property. In case of walls, the extracted geometry does not contain the structural layers of the wall. A different method described here, has been used to extract the layer geometry. However this method adds some overhead to the definition runtime due to the temporary transactions that are needed

Use the Element Parts Geometry component shown here to extract the layer geometry of a Basic Wall instance:

This component can be used with Stack Walls as well. The component will extract the structure layers of all the partial Basic Walls that are part of the given Stacked Wall:

A better method is to extract the Basic Wall instances first from the Stacked Wall, and then use the component to extract their layer geometry. This method would result in a more appropriate data structure that keeps the layer orders intact:

To keeps the geometry list extracted from layers in identical order as other components that deal with layers, you can sort the geometry list by the distance from the wall orientation vector. This works best with flat walls of course but similar methods can be used to sort the layer geometry on other walls (think of basic walls stacked in a stacked wall instance with different structures):

### Modifying Profile

 Modifying wall profile curves are not supported by the API at the moment

### Creating Stacked Wall Type

 Currently there is no support in Revit API to create new Stacked Wall types

## Creating Walls

### By Base Curve

Use the Add Wall (Curve) component to create a new wall based on the given curve. In this example the Graphical Element parameter is referencing a series of Revit model lines:

### By Profile

Use the Add Wall (Profile)+ v1.0 component to create a new wall based on the given profile curves. Note that the profile must be a closed loop, planar, and vertical. In this example we are using the Join Curves component from Grasshopper to join the curves. The Graphical Element parameter is referencing a series of Revit model lines that have modeled vertically and on a single plane so we know they are planar: