Symbol string replacement failure using ${VALUE}

I’ve tried to use the new string replacement variable ${VALUE} along with an environment variable that I’ve defined ${KICAD_USER_DATASHEET_DIR} and it does not expand to the expected path.

The value field for the symbol is the symbol is TI-BQ25171

I tried setting the symbol for the datasheet field like this…
${KICAD_USER_DATASHEET_DIR}/${VALUE}/${VALUE}.pdf

Strangely, it did not expand to…
${KICAD_USER_DATASHEET_DIR}/TI-BQ25171/TI-BQ25171.pdf
(which works when I don’t use ${VALUE})

Is there some sort of limitation on how many string replacements can be used?

For reference, here is my complete metadata for the symbol…

The only limit is for nesting depth of references (and that’s 10).

What version are you using?

Hi Jeff. I am using 6.0.1-0, release build.

Would you happen to know if this way of using string replacements is valid/correct?
${KICAD_USER_DATASHEET_DIR}/${VALUE}/${VALUE}.pdf

It should work in the Schematic Editor.

It won’t work in the Symbol Editor. (I’m not sure whether or not we evaluate environment variables in the symbol editor, but we definitely don’t evaluate text variables.)

1 Like

Hi Jeff, I used your debugging technique to show the ‘Datasheet’ field in the Schematic Editor.

First with ${VALUE}…

Then with the string literal…

Both have the same result on the schematic, this is ok.

But when attempting to “Show Datasheet” in both cases…

Only when using the string-literal does the datasheet open as expected. When the ‘Datasheet’ field contains ${VALUE} as in the screenshot above, the datasheet does not open, a file-picker dialog is shown instead.

From this, it seems that string replacements are applied properly for the Schematic Editor canvas, but not for the Schematic Editor’s “Show Datasheet” function.

Maybe this is a bug?

Indeed, we don’t resolve text variables there. Please log a bug in GitLab.

1 Like

kindly go through the datasheet of schematic editor. check the limit of nesting.

Roger that :+1: bug logged…

#10928

2 Likes

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