Resorted to text editing .lib file to fix my power symbol

I have been making my own component symbols and those seem to be working OK. I tend to copy something which is similar to what I want and then edit it to make a new component.

I wanted to add this question to an earlier similar discussion but that one is closed to new questions/comments. (Why do we close these discussions if the software is similar?) My software version is shown at the bottom of this.

Anyway I have copied a +12V symbol to make a +18V symbol. I thought it indicated +18V but the netlist connected this to my +12V. When I try to edit my “+18V” symbol, the symbol editor shows some “invisible” “+12V” text which I could not change.

So…with my “damn the torpedoes” attitude (which crashed my keyboard a few days ago) I opened up the “.lib” file in my text editor. The text below is the result after I changed the text in the line which starts with “X” from “+12V” to “+18V”.

+18V

DEF +18V #PWR 0 0 Y Y 1 F P
F0 “#PWR” 0 -150 50 H I C CNN
F1 “+18V” 0 140 30 H V C CNN
F2 “” 0 0 50 H I C CNN
F3 “” 0 0 50 H I C CNN
DRAW
P 2 0 1 0 -30 50 0 100 N
P 2 0 1 0 0 0 0 100 N
P 2 0 1 0 0 100 30 50 N
X +18V 1 0 0 0 U 50 50 1 1 W N
ENDDRAW

This seems to work and pcbnew now is showing the desired connections after reading the netlist. Was text-editing the .lib file a bad idea? And if it is OK; it seems that the software ought to be able to do it without too much difficulty?

Thanks. This is my KiCad version report:

Application: kicad
Version: (5.0.2)-1, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.61.1 OpenSSL/1.1.1 (WinSSL) zlib/1.2.11 brotli/1.0.6 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) nghttp2/1.34.0
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.68.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.61.1
Compiler: GCC 8.2.0 with C++ ABI 1013

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=OFF
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON

No need to start the text editor. All of this can be done inside of kicad. See the “how to make a custom power symbol” part of my Tutorial: How to make a symbol (KiCad v5.1.x)

Thank you. I tried creating a new power symbol, but I did not see how to get to this dialog box which you show?

image

I reread my tutorial and it is not really geared at explaining how to change an exisitng symbol.

To change the pin name that is responsible for creating the net name (the thing where you used the text editor) is done by rightclicking on the pin -> edit or by using the hotkey “e”
It might be necessary to select “show hidden pins” depending on which version of kicad you use to be able to see the pin in the first place.
This is made harder by the fact that pins for power symbols have 0 length. (You will see a small gray circle that indicates the pin itself. This is where you need to click or have your mouse when using the shortcut.)

This should pop up when you place a new pin. (explained at an earlier stage of the same tutorial. It is kind of assumed that readers start at the top and work their way through all of it. I did point you to this part of the tutorial as i assumed you where familiar with the library editor in general. My bad.)

Thanks, Rene

I need to work on this a little more. Right now the text editor seems easier. :frowning:

hint: the place menu is a good starting point to look for when trying to add anything to the symbol. (Also most tools require a click on the canvas before anything happens.)

I see that now. Thanks a lot for your help.

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