PCB Configuration Variables VS Page Setup Variables

I have learned that I can define my own text variables in the
EESCHEMA: Project->Text Variables or PCBNEW Text & Graphics → Text Variables.
Variables defined here are available both in EESCHEMA and PCBNEW as they are stored in the *.kicad.pro file.

In addition to this both EESCHEMA and PCBNEW have a dialogue called “Page Setup” where information can be entered that will be displayed in the drawing frame box. This information is stored in *.kicad_sch / *.kicad_pcb.

I can use these variables in EESCHEMA and PCBNEW by placing text with ${VARNAME} that should be substitued with the value of that variable.

In the Kicad Manual some variables are listed, like REVISION, TITLE, COMPANY…

Strangely when I define COMPANY in the project wide variable setting this variable is not expanded to either title block text or text anywhere in the schematic / PCB layout.
When I input something for Company in “page settings” dialogue this gets expanded, but only in the program (EESCHEMA / PCBNEW) where I configured this variable.
In the other program this variable does not expand.

I would expect that any variable that is defined in the *.kicad_pro would be available in both EESCHEMA and PCBNEW.
I would like to use the “Copy from other Project” option to set my COMPANY variable.
Also I would like to update the REVISION on both my schematic and my PCB to have the same information in sync.

Is there a reason for this behavior? Any reply appreciated.

  1. variables defined in project text variables (whether schematic editor or pcb editor) are project-wide, as you say
  2. Built-in variables like ${COMPANY}, ${COMMENT1}, ${CURRENT_DATE}, ${SHEETPATH}, etc. can’t be overridden by project text variables. I think this is what you’re running up against.
  3. Some of the built-in variables refer specifically to drawing sheet fields, like ${COMPANY}, ${ISSUE_DATE}, or ${COMMENT1}. These are specific to each sheet, not just schematic editor vs pcb editor, so they have to be set in each sheet in your schematic and in your PCB. If you want these to be the same everywhere, you have to set them all to the same value. You could set them all to a project text variable, if you wanted (e.g. ${MY_COMPANY}).

Because you can’t override the sheet variables like ${COMPANY}, you will have to name your variable something else, like ${MY_COMPANY} or ${COMPANY_NAME}.

Many Thanks for your reply!

It is sooo great that the fields in the page setup dialogue also accept variables and expand them:

In the page setup dialogue in EESCHEMA / PCBNEW I have entered a ${MY…} like
grafik
In the Text variable definition in the Schematic/PCB Setup dialogue I define these variables and assign a value to them.

Doing so I have the same data in both title blocks of schematic and PCB layout. Also I can add the revision information on my PCB, by placing ${REVISION} on my PCB.

This was exactly what I was looking for! Again, many thanks for your support!

1 Like

Funny enough I use ${COMPANY} variable defined in the Project Text Variables, then called it in the “Page Setup” as “Company: ${COMPANY}” in Company field. Added it to page template title block in both: Schematic Editor and PCB Editor and it works fine.

Didn’t know until now that they (“project text variables” and “page setup variables”) are separate :crazy_face:.

Hey that is really strange. :thinking:

Hadn’t though of adding ${COMPANY} in Page Setup Dialogue. That’s kinda like recursion :stuck_out_tongue_winking_eye:

Defining variables with MY… in project setup and referring to them in page setup should be clear for other users as well.

Thanks for your support! :+1: :+1: :+1:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.