← Back to team overview

kicad-developers team mailing list archive

Re: $comp file format question


Thanks for the explanation. 

Is the AR field documented anywhere? Are there any other undocumented .sch

It would seem to me that the extraneous/obsolete AR fields should be deleted
when the file is saved since they are no longer need for undo commands.



-----Original Message-----
From: Kicad-developers
On Behalf Of jp charras
Sent: January 14, 2019 2:58 AM
To: kicad-developers@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Kicad-developers] $comp file format question

Le 13/01/2019 à 17:50, Brian Piccioni a écrit :
> Hello
> I am looking at damaged schematic file someone sent me. It has fields 
> like this
> $comp
> L Device:LED_ALT D?
> …
> …
> AR Path="/5C0355BF/5C061BDB" Ref="D?"  Part="1"
> AR Path="/5C048F20/5C061BDB" Ref="D103"  Part="1"
> I suspect the problem is that a hierarchical sheet was deleted before 
> annotation and the sheet was not “cleaned up” by KiCad so the “ghost” 
> of the sheet remains in the file format. I think I have seen this 
> before and might have raised it as a bug. Eventually I am going to try 
> and replicate this issue and if I can I’ll file a bug report.
> Nevertheless, when I consult the file formats PDF linked here 
> http://kicad-pcb.org/help/file-formats/  (pages 3 and 4) I see no 
> definition for the AR field. There is no date/version number on the 
> PDF, so I assume it is the most recent one, but I don’t know for sure.
> Is the file formats document link pointing to an obsolete document?
> Can someone kindly point me to where the AR field is documented?
> Thanks
> Brian
I forgot to define the AR fields in the file formats document.

AR is the alternate reference used in complex hierarchies.

In simple hierarchies the F0 field contains the component reference.
But in complex hierarchies, there are more than one reference:
for each instance of the shared sheet, a specific reference is needed.
The AR line defines the reference and unit for each sheet path.

When switching to a given instance (known by its sheet path) of a shared
sheet, the corresponding AR is copied to the F0 field of every component.

AR are cleaned only when clearing the full annotation, not when deleting a
sheet instance.
Otherwise when undoing a deleted sheet, AR references will be lost (as they
are living in a other hierarchical sheet, or many other hierarchical

There are no issue with no existing sheet paths, they are just not used,
like many other symbol fields.

Jean-Pierre CHARRAS

Mailing list: https://launchpad.net/~kicad-developers
Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp

Follow ups