Following the path read from a fz file to a fzp file

I am trying to write a program which reads fz-files for a university project.
Recently I realized that the information in the fz-files might not be enough for my purposes (a very abstract description of the fritzing project (how parts are connected and such)).
I need to know the family of a part, which is a property included in the parts fzp-file.
Luckily, the path to the fzp file is an attribute of the instance tag in the fz file, so I thought I could just follow this path and read the fzp-file to get the family property.
For some paths, this works, but there are also paths like this: “:/resources/parts/core/wire.fzp”, for which it fails.
I am unsure how to best work with this. Has the colon a special meaning here that I am missing? There is a “resources” directory in the fritzing-app repo, which has the file I want to read, but does this also work if somebody does not have the repo but downloaded fritzing for example using apt? I can’t find a “resources” folder.

You need to Fritzing source repo from github. The resources directory is in there (I expect the associated parts get loaded in to the parts directory.)

$ ls fritzing-app/resources/parts/core
30.20PerfboardModuleID.fzp netlabel_left.fzp
30.20Stripboard2ModuleID.fzp newbreadboardlogoimage.fzp
30.20StripboardModuleID.fzp newcopper0logoimage.fzp
blocker.fzp newcopper1logoimage.fzp
blocker0.fzp newlogoimage.fzp
boardlogoimage.fzp newschematiclogoimage.fzp
boardlogoimage_one_layer.fzp newsilkscreen0logoimage.fzp
breadboardlogoimage.fzp note.fzp
breadboardlogotext.fzp pad.fzp
cmRuler.fzp pad0.fzp
copper0logoimage.fzp power.fzp
copper0logotext.fzp power_label.fzp
copper1logoimage.fzp rectangle_pcb.fzp
copper1logotext.fzp rectangle_pcb_two_layers.fzp
dcpower.fzp roundrect_pcb.fzp
ellipse_pcb.fzp roundrect_pcb_two_layers.fzp
ellipse_pcb_two_layers.fzp schematic_frame.fzp
ground.fzp schematiclogoimage.fzp
groundplane.fzp schematiclogotext.fzp
hole.fzp silkscreen0logoimage.fzp
jumper.fzp silkscreen0logotext.fzp
logoimage.fzp via.fzp
logotext.fzp wire.fzp
netlabel.fzp

Peter

1 Like

Thank you.
Do you maybe know why there are some references that give a absolute path I just need to follow and references into the resources. Why not give references to the parts directory in both cases?

In a word, no :slight_smile: . That was a decision by the developers long before I came to Fritzing.

Peter

1 Like