SetHostWallId Method


Wall Set Host Wall Id Method

Associates this wall with the specified host wall. If the host wall is set, this wall will follow the host wall to move or change slanted angle. The Hosted parameter will be shown in schedule and view filter.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 27.0.4.0 (27.0.4.0)
Syntax
public void SetHostWallId(
	ElementId hostWallId
)

Parameters

hostWallId ElementId
The element ID of the host wall to associate with. To disassociate the wall from its current host wall, use invalidElementId. If the wall is already associated with the specified host wall, this function does nothing.
Exceptions
Exception Condition
ArgumentNullException A non-optional argument was null
InvalidOperationException
  • Either wall is not qualified for the association. E.g. The wall is a stacked wall.
  • The association would create a circular dependency between walls.
  • The wall spans do not overlap.
  • The walls are misaligned and cannot be associated.
  • A pinned wall cannot participate in the association operation.
Remarks
If the wall is already associated with another host wall, it will first be disassociated from the current host wall before being associated with the new host wall. After associating a wall with a host wall, the "Offset from Host" parameter can be accessed and modified using BuiltInParameter.WALL_OFFSET_FROM_HOST to control the wall's position relative to its host. The "Offset from Host" parameter is initialized to 0 when the wall is associated with a host.
See Also
ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →