Component classes and directive labels-How can they be used?

How can component classes and directive labels be used? Could someone give me a simple example of their use in a schematic and PCB? Thanks.

I assume you mean this: Post-V8 New Features and Development News - #49 by JamesJ I’ve added the tag 8_99 so people don’t go looking for it in v8.

Yes. Thanks for tagging it appropriately.

As one example, you can use them along with the multi-channel tool to replicate PCB layouts for repeated schematic elements from a single schematic.

Also they can be used for custom DRC rules which should only apply to certain components (e.g. to enforce placement restrictions for noisy and / or sensitive parts).

1 Like

Expanding a bit on James’ post:

Component classes: There are two ways to use them right now: for the multichannel tool (to identify which components belong to a channel) and for writing custom rules.

The custom rules system can use component class as another way to select what items to apply a rule to. In previous versions of KiCad there were various ways to select objects, including based on their physical location (using a Rule Area) or based on typing in their reference designator. For example, “allow tighter clearance and smaller track width inside the courtyard of U3” from the Custom Rules help window:

(rule "BGA neckdown"
   (constraint track_width (min 0.2mm) (opt 0.25mm))
   (constraint clearance (min 0.05mm) (opt 0.08mm))
   (condition "A.intersectsCourtyard('U3')"))

This works fine, but you need to edit your rules if you want it to apply to more than one part, or if you want to rename U3 to U4. Component classes allow you to set up a class that is defined in the schematic and can apply to multiple components. You could then write that rule as “allow tighter clearance inside the courtyard of any BGA part” and then you do not need to update the list of reference designators in that rule when you add a new BGA part, instead you just add a component class directive in the schematic and the rule will apply to the new part

(removed rule; this doesn’t actually work yet in 8.99 and needs to be fixed)

Directive labels are a way to apply a certain directive to objects in the schematic. Directive here means something like “add to this netclass” or “add to this component class”.

2 Likes