Creating Part Issues

Hello, I am pretty beginner and I need some help please. I was trying to create a 6xAA fritzing part for learning the basics, but I am encountering mainly a Breadboard view and PCB view issues. I will describe a little bit the steps I have done because I am not pretty sure if I have followed a good method neither good practices. I have followed some tutorials from the fritzing and some tutorials from some blogs.

Firstly, I have started my part from the “Battery” “Your standard 2x AA battery pack (3 Volts)” which I don’t know how to add the .fzpz here. It can be found at Core Parts → Power (I think).
But this is the Breadboard original svg: (I add at the end of all svg files the “.fzpz” because I read somewhere that forum can not deal good with .svg)
2xAABreadboard

The next thing I have done is with Inkscape edit the 2x AA battery svg and I have converted into a 6xAA battery svg for breadboard (I think I have not used too many good practices for doing it).
This is how it firstly seemed to look:
6xAApropioBreadboardV1

Here is where I have the first problem, the original part is odd and is using rubber band legs (as well refereed as bendable legs):
error1

I did not want them because of personal criteria and because if I used them, the fritzing part would look like this at the breadboard view:

So I have edited some hierarchy with Inkscape (I think I have not used the hierarchy pretty good) and I have as well edited the xml file with VSCode and commented the parts that I think are the band legs:
6xAApropioBreadboardV3

With that done, now I have “succesfully” (I don’t know if I have done it properly, but at least I am not anymore getting the first error) removed the rubber band legs. But now my issue is at selecting the graphic, fritzing selects the following:
graphicIssue

First Issue:
At this point I think I had been able to design the 6xAA svg even though I might have used bad practices (which I am not capable to notice due to that I am pretty beginner). But for making the part I would prefer that the graphic was just the black pin, in the case of the image and the red pin and I don’t know how to do it. I have searched information if this could be related to the bendable legs, but I have not found anything that helped me.

After that, I knew that I had to make a svg view for the schematic and PCB views. And with the PCB view is where I have my other main issue. I have as well used the svg of the PCB view of the same original part “Battery” “Your standard 2x AA battery pack (3 Volts)”:
2xAAPCB

Second Issue:
By doing that now I get the following error:
error2

By changing some hierarchy using Inkscape I managed to get rid of the error, but I don’t know if it is a good thing. How could I do it in a more properly way?
PCB SVG with changed hierarchy and not getting the error:
6xAApropioPCBV2

(for the hierarchy I mainly used this structure: Fritzing Blog)

Summary: My mainly problem is how to remove rubber band legs and make the graphic good look, how to unbroke PCB view proper way and finally that I have a problem with good practices that I would really appreciate if I get some explained to me please.


PD: I don't know if I am adding in a good way the files, so you could be able to download them and check the xml code, if not please could you let me know?

The procedure is described here

but he doesn’t appear to have posted the final result that I can see. Your svgs posted as svgs (the forum has gotten better with svgs.) They can be downloaded by right clicking on them. I’ll have a look and point out problems and create a part.

edit: Here is a part created from your svg. If you unzip the .fzpz file you will get the.fzp file and the three svgs which you can then look over to see what a correct part should look like. This part has been run through FritzingCheckPart.py (available in the tutorial listed above) to clean up various things Fritzing doesn’t like about Inkscape (or most any svg editor.) You should do the same if you make changes.

6xAA-battery.fzpz (13.8 KB)

Feel free to ask about anything you don’t understand.I’m always happy to help people make parts.

Peter

Hello vanepp :wave: , thanks for the help :grinning:, but I have some questions:

  • Firstly, have you done the modifications via Inkscape or have you edited manually the xml? Furthermore, from which svg for the breadboard have you started to modify?


  • Next, I have seen that I have to delete “legId” for removing the bendable legs.

but I don’t have any “legId” on the svg. I think I just have the following code related to the bendable legs:

<rect
         y="32.496899"
         width="1"
         fill="#8c8c8c"
         height="2.9999001"
         id="connector1pin"
         x="161.495" /><g
         stroke="#000000"
         stroke-width="3"
         stroke-linecap="round"
         y2="47.689"
         fill="none"
         y1="47.689"
         x2="172.827"
         id="connector0leg"
         x1="167.161" /><g
         stroke="#ff0000"
         stroke-width="3"
         stroke-linecap="round"
         y2="33.998"
         fill="none"
         y1="33.998"
         x2="172.827"
         id="connector1leg"
         x1="167.161" />

So, how have you deleted the bendable legs? and for the square pads it can be used any svg graphic, there is not any necessity of using any tag at xml right?


  • Concerning to the script you have created, is there a way to use it without using cygwin? and how many times and when have you use it for improving the part?


  • Finally, does fzpz stands for FritZing Part Zip?

I used Inkscape on the svgs and a text editor on the fzp file. Once you get used to how Inkscape does things it isn’t that bad. I know a number of tricks to make things easier as well.

The second one above, this one:

The legId is in the fzp file and the breadboard svg, so you need to use Inkscape to delete the legId in the svg (and reset the view box by resizing the image because bendable leg parts require an odd viewbox setting to work) and a text editor to modify both connectors in the part.6xAA-battery_1.fzp file from the fzpz file.

    <connectors>
        <connector type="male" id="connector0" name="Pin 0">
            <description>Pin0</description>
            <views>
                <breadboardView>
                    <p svgId="connector0pin" layer="breadboard"  legId="connector0leg"/>
                </breadboardView>
                <schematicView>
                    <p svgId="connector0pin" layer="schematic"  terminalId="connector0terminal" />
                </schematicView>
                <pcbView>
                    <p svgId="connector0pin" layer="copper0" />
                    <p svgId="connector0pin" layer="copper1" />
                </pcbView>
            </views>
        </connector>

to

    <connectors>
        <connector type="male" id="connector0" name="Pin 0">
            <description>Pin0</description>
            <views>
                <breadboardView>
                    <p svgId="connector0pin" layer="breadboard"/>
                </breadboardView>
                <schematicView>
                    <p svgId="connector0pin" layer="schematic"  terminalId="connector0terminal" />
                </schematicView>
                <pcbView>
                    <p svgId="connector0pin" layer="copper0" />
                    <p svgId="connector0pin" layer="copper1" />
                </pcbView>
            </views>
        </connector>

If you don’t do both the part won’t work. The fzp file is the control xml which deals with all the svgs (and defines where they are and a lot of other things.) AFAIK parts editor can not modify the fzp file at least not to change the number of pins which is why they suggest you start from an existing part with the correct number of pins. In practice so long as you know what you are doing (which took me about 1 1/2 years to learn) you can make a part from scratch. So I just ignore parts editor and edit the file directly. Note that after modifying a svg with Inkscape you need to either use a text editor of FrtizingCheckPart.py to remove the px settings on the font-size specification in the svg. If the font-size has a px Fritzing will either set the font size to 0 (so the text is too small likely) or set it to something like 255 which makes the text huge. I normally run all finished parts through FritzingCheckPart.py to make sure all is well. All of this is covered (along with more of the things that can go wrong) in my tutorial set. Parts making is complex and takes a while to understand what all the xml does and how it interacts. Added to that is there is special code that is trigger by various things (moduleId, family, some of the properties) which are mostly undocumented. Some of them have been documented in my tutorial, but certainly not all.

Peter

Okey thanks.
I have done some visual modifications to the svg you provided from the fzpz with Inkscape, (after some troubles with cygwin) I have installed your script and I have run the script with the svgs after being modified with Inkscape. But I have some questions about the messages that the script provides:

In the breadboard one I did not get any error:
6xAABreadboardFinal

In the schematic one I get the following:
6xAASchematicFinal

Modified 1: File
'6xAASchematicV2.svg'
At line 213

Removed px from font-size leaving 2.50001

Modified 1: File
'6xAASchematicV2.svg'
At line 226

Removed px from font-size leaving 2.50001



Error 77: File
'6xAASchematicV2.svg'
At line 250

terminalId connector0terminal can't be a g as it won't work.

Error 77: File
'6xAASchematicV2.svg'
At line 274

terminalId connector1terminal can't be a g as it won't work.

In the README.md you specify:

Error77: File
‘filename.fzp’ At line 20

terminalId can’t be a path as it won’t work.
The terminalId can’t be of the specified type (currently path, but there may be others that will get added). Unless it has a center such as a rectangle, line, or polygon fritzing won’t take it as a terminalId and will default to the center of the svgId which likely isn’t what you want. I prefer to use a rectangle of .01in by .01in for terminalID.

But I don’t know what I am supposed to do as I searched terminalId in the 6xAASchematicV2.svg and I don’t find it for modifying.
Maybe, one thing that it might be related with this is that I don’t have any fzp? I don’t know how to make the fzp, so I will create the fpzp with the correct svg parts with fritzing and then unzip it and run the script with the fzp. Am I good if I do this?

For the PCB view:
6xAAPCBFinal
I get “This is a through hole part as both copper0 and copper1 views are present.”, is this just an informative message? Or should I do any modification?

Thanks for all, Venaber.

There are several problems here. As FritzingCheckPart noted the terminalId is a group (which contains no drawing elements) and thus won’t work. This:

Which as you see selects nothing in the document, needs to change to this:

where the rectangle appears on the end of the pin where the wire should connect. As well the battery is too large for schematic. It is preferable to use the current battery symbol so batterys are interchangeable. Finally if you don’t have an fzp file you can’t load the part because the loader needs the fzp file to load the part. You should probably start from the .fzp file in my part ( part.6xAA-battery_1.fzp) which can be obtained by unzipping the 6xAA-battery.fzpz file. In there the labels on the connector0pin are incorrect. Fritzing will ignore the inkscape label connector0pin and use the id value connector1pin-8 which doesn’t occur in the .fzp file.

as noted it would be preferable to use the same schematic as is used by all the other batteries that is in my .fzpz file and looks like this:

which in turn matches the definition in the .fzp file here:

    <connector id="connector0" type="male" name="Pin 1">
      <description>BAT-</description>
      <views>
        <breadboardView>
          <p svgId="connector0pin" layer="breadboard"/>
        </breadboardView>
        <schematicView>
          <p svgId="connector0pin" layer="schematic" terminalId="connector0terminal"/>
        </schematicView>
        <pcbView>
          <p svgId="connector0pin" layer="copper0"/>
          <p svgId="connector0pin" layer="copper1"/>
        </pcbView>
      </views>

The definitions in the .fzp file need to be reflected in the various svg files, FritzingCheckPart will complain about things that don’t match (it reads the fzp file to find the svgs.)

Once all that is done run the .fzp file through FritzingCheckPart.py like this:

$ FritzingCheckPart.py part.6xAA-battery_1.fzp
File
‘part.6xAA-battery_1.fzp.bak’

This is a through hole part as both copper0 and copper1 views are present.
If you wanted a smd part remove the copper0 definition from line 45

and yes the through hole (as opposed to SMD) message is informational and will probably be removed (as it causes confusion) if I get around to updating FritzingCheckPart in future.

Peter

So much thanks vanepp, really :grinning:, thanks. I have done the following:

  • As I needed the 6xAA battery with that schematic I have created the following part (I just share it in case someone needs the same schematic as me):
    6xAABatteryUnSc.fzpz (16 KB)

  • But, as I wanted as well to follow your tips I have as well done a part with the usual schematic:
    6xAABatteryUsSc.fzpz (15.4 KB)

6xAA Battery
With Usual Schematic (download this if you are searching for normal representation for 6xAA):
6xAABatteryUsSc.fzpz (15.4 KB)

With Unusual Schematic (see differences at the end of the post):
6xAABatteryUnSc.fzpz (16 KB)

Note that the files are differenced by “UsSc” and “UnSc”, meaning respectively “Usual Schematic” and “Unusual Schematic”.

Differences: By Usual Schematic I refer to the schematic that is usually used for the schematic representation of batteries. By Unusual Schematic I refer to a representation of the 6 AA batteries in series that I have made specially using my criteria and my requisites. In addition, you may find some differences in the xml code as I have changed some id’s. (I as well share this second file if someone maybe need it.)

If you download both of the files, you can change the schematic representation in the label part between the usual or unusual.