How to add 3D (.stp) file to a footprint in my custom library

Hi,

most tutorials show how to do it localy, on the pcb, on one footprint instance

but what if I wanted to add an stp to the footprint itself??? I mean IN THE LIBRARY ???

I got like 100 switches for a keyboard, adding the stp file to one switch footprint, does not update the library

and it makes no sens to do it 100 times

how do I add an stp to my library so it is updated for ALL FOOTPRINTS on the whole pcb ?

thanks

Which KiCad Version are you using?

When you first place a footprint on the PCB a copy of the footprint is saved in the pcb. After that point any changes made to the library is only in the library, not on the PCB. This is so any updates to your library doesn’t break your previously made PCBs. But, there is a way to update footprints in the board from the library. For my screenshots, below, I’m using the current stable (v5.1.9). Other versions may have slightly different UI element placement and/or workflow.

In the Tools menu of PCBNew there is an entry called Update Footprints from Library....
2021-04-08 10_26_06-Pcbnew — C__Users_chelliot_Dropbox_RemoteDevelopment_KiCad_KiCad5TestNewHierarch

And, here is the dialog that you get. There is a lot of power with this dialog, so you may want to play with it on a copy of your board (or in a test project).


You’ll want to use the Update footprints with identifier: radio button. But note that the identifier field is blank. Unless you remember what the footprint name is and can easily find it when clicking on the books-on-a-shelf button (will open the library browser), this may seem to be a dead end. Fear not, there is another way to get to this same tool that will have the footprint name filled in for you.

Close this dialog, and select one of the footprints within the set of footprints that you want updated. Press the e key (or right-click and select Properties... from the context sensitive menu). On a sample board of mine when doing this to resistor R3 I get this properties dialog:


You can see on the bottom line of this dialog the library reference for this part. Unfortunately, you can’t select it to copy to the clipboard. But you don’t need to for this excercise. Click on the button that I’ve highlighted with my mouse pointer, Update Footprint from Library.... This will get you the same library update tool, but with the footprint value already filled in:

You’ll want to change the radio button from Update selected footprint to Update footprints with identifier: to reload all the footprints that you’ve added your .stl to in the library.

Hope this helps.

I use 5.1.9

thanks, I’ll check it out

how do I add 3D files from the start, when creating a component footprint

Yes but you made it sound as if you already have them on the PCB which is why @SembazuruCDE showed the workflow how to then get any modification of the lib onto the exising PCB.

For adding it to footprints check out Tutorial: How to make a footprint in KiCad 5.1.x? section 3D-Model handling

1 Like

ok thanks I’ll check it out

actually they are already on the pcb so I was planning to redo it from the library, then update the pcb

So in the end follow the tutorial for adding the 3d model within the lib. And after that follow what @SembazuruCDE shows above.

The reason that this is necessary is because KiCad includes the footprint data inside the PCB file and does (for good reasons) not update from the library automatically.

  • I select the footprint I added a 3D stp file to (in the “3d Settings” tab)

  • I then go back to “General” tab, I click on “Update from footprints”

  • I choose “Footprint from identifier” and the identifier is already there

  • I click on update, then go to the 3d view, the component I added a 3d object to, has lost its 3d object :frowning:

maybe I am missing something

how does the dialog knows to copy the selected/updated footprint ? it’s getting scratched like all other footprints with the same identifier

You should not set the 3d model for one footprint placed on the board. You need to set the model in the library itself. For that open the footprint editor from the main menu, in it open the footprint and set the model then save this modified footprint. Only after that can you use the process described by @SembazuruCDE to get all footprints updated.

1 Like

sorry I don’t get it, in the tutorial it just shows how to add the stp to the footprint, not the library
also you said the 3D model was, I quote “not automatically stored in the library for good reasons”

Ok I found out I could edit the “Footprint properties” in the library editor

my bad

As @Rene_Poschl points out you are only modifying that one footprint instance on your board, not the one in your library. In my 3rd screenshot, above, the bottom button in the column where my mouse pointer is (Edit Library Footprint...) is a shortcut to editing the library footprint for the one you are editing the properties of in PCBNew. Once you make the edit in the library (as long as it isn’t one of the provided libraries) then you can use the Update Footprint from Library... to update all the footprints of the same type on your board. (Even if you need to save your edits to a personal library out of the provided library, you should be able to then use the Change Footprint... to get this where you can change every footprint from the old footprint to your newly edited footprint:

You might want to read my post again as you have a massive misquote here.

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