KB: How to create an area on the PCB where component footprint placement is restricted based upon footprint height
Solution Details
General Information
The following steps are based upon Altium Designer version 24.9.2. Some methods to access properties and related may be different with respect to other versions. The steps will focus on the outcome with minimal deviation into other nuances, that is there is some expectation of familiarity with general Altium Designer usage and functions. This solution is solely text-based.
Overview
The abbreviated steps for the solution are as follows:
-
define the height of PCB component footprints; then,
- define an area within the PCB document using the Room Definition design rule; and,
-
define a Height design rule scoped for that room; then,
- use the design rule check system to report violations when a component footprint's height exceeds the rule value within the defined area of the PCB.
PCB Footprint Height Definition
Each PCB footprint will have its own defined height value. The height value will be taken from, in order of priority, either included 3D Body objects, or the footprint's defined Height value. To define height values:
-
open a footprint in the PCB Library editor; and,
- from the Properties panel in Library Options mode (upper-left), select the Footprint tab, and in the Properties section locate the Height field, enter a suitable (assumed maximum) height for the footprint;
- note: if there is no 3D Body object in the footprint, this Height field will define the height for the footprint with reference to the PCB document's Height rule; otherwise,
- optional, if a 3D Body is placed into the footprint this will serve as an override for footprint (geometry and) height, a 3D Body can be either (a simple) Extruded 3D Body, or a (detailed) 3D Body Generic (supported 3D) model - supported 3D model types are STEP or Parasolid or Solidworks Part;
- for an Extruded 3D Body, PCB Library editor main menu Place » Extruded 3D Body, define the body outline, and in the Properties panel in 3D Body mode, in the Properties section locate the Overall Height field, enter the maximum height for this Extruded 3D body; or,
- for a 3D Body using a supported model type, PCB Library editor main menu Place » 3D Body, in the Choose Model file explorer navigate to the Windows folder containing the supported format model file and select the target file and [Open], then for the placed 3D Body use the Properties panel in 3D Body mode to to set suitable properties for the object.
PCB Area Definition using the Room Definition Design Rule
An area within a PCB document, where it is desired to restrict footprint placement based upon heights, can be defined by a Room object. A Room object is structured into the design rules system:
-
in the target PCB document;
- from the PCB Editor main menu Design » Rooms » Place * Room, where * can be either Rectangular or Polygonal;
- interaction with the placed room definition can be done through either double-left-mouse-button-click on the room, or PCB Editor main menu Design » Rules... - and in the PCB Rules and Constraints Editor [<PCB-Units>] dialog navigate to Design Rules » Placement » Room Definition;
- for the purposes of this solution, only setting of the Name of the Room Definition will be considered, therefore set the room Name to a suitably descriptive value - for example RoomDefinition_FP-Height-Max-Value to describe a footprint's maximum height value within the room area.
PCB Height Rule Definition to Restrict Footprint Heights Within the Defined Room (Area)
With the target area defined by the room object, a PCB height rule can be defined to constrain heights of footprints within that area:
-
from the PCB Editor main menu Design » Rules...; and,
- in the PCB Rules and Constraints Editor [<PCB-Units>] dialog navigate to Design Rules » Placement » Height;
- note: there will be a default height rule created with the PCB document, it is recommended to retain this rule as a catch-all (lowest priority) rule to cover all objects within the PCB document;
- create a new Height design rule; and,
- set it as highest priority; and,
- set a suitably descriptive Name e.g. Height_WithinRoom_<MaximumAllowedHeight>; and,
- set Where The Object Matches using the dropdown selection box to Within Room;
- which will enable a subsequent dropdown selection box to choose any available named room within the PCB document, choose the named room accordingly; and,
- set Constraints for Minimum and Preferred and Maximum.
Using the Design Rule Check System to Flag Violations
The design rule check system can be used to flag violations to the configured height rule, the height rule supports both Online and Batch design rule checking, configuration and violation can be pursued as follows:
-
enable Altium Designer online design rule checking through Preferences » PCB Editor » General » Editing Options » [X] Online DRC; and,
- enable DRC checking for the height rule, PCB Editor main menu Tools » Design Rule Check..., and in the Design Rule Checker [<PCB-Units>] dialog select Rules To Check » Placement, and for the Height design rule enable Online and/or Batch using the corresponding column checkboxes; and,
- with reference to Online DRC, the action of moving a component footprint will assert violations for that footprint;
- note: WithinRoom will flag violations when the complete footprint is within the room; but,
- note: there is the option to use a design rule scoped for Where The Object Matches a Custom Query set to TouchesRoom('<RoomName>'), which will flag a violation when the component footprint touches the room; additionally,
- with reference to Batch DRC, a Batch DRC can be run specifically for the Height rule from the PCB Rules and Violations panel, or for the complete PCB using main menu Tools » Design Rule Check... and from the Design Rule Checker [<PCB-Units>] dialog lower-left selecting the [Run Design Rule Check...] button.
Links for Documentation References
Adding Height to a PCB Footprint