Help please to edit a component in inkscape and then use it

I just tried to use the original ‘car relay’ in the parts library and that doesn’t link wires to the pins either. It looks as if it tries to link them to the pins of the relay and not the pins of the drawing, do you agree with that?

You have to mod all the svg views and assign pins in FZ Editor, like in the video.

the breadboard view doesn’t see them as pins. Take a look at the car relay and try to link wires to it. You can see the position of the the connections on the relay as ‘foggy’ squares ‘under’ the breadboard view, it tries to link the wires to these.

That is just a silkscreen SCH of the circuit, so those ends are not connectors. The connectors are those 5 brown rectangles, that are the spades that plug into a socket.

If you post your part here we could probably make better suggestions for changes. A quick look at car relay in core indicates to me it is pretty broken though.


It looks like what it is supposed to be, what’s broken besides the pins could look a bit better.

http://www.quartz1.com/price/techdata/nvf4-1_nvf4-2.pdf

While I guess broken is too strong, will ugly do :slight_smile: ?

while technically the connections work, the presentation however is ugly. I think the terminals at least in bb should be oriented on the circular terminals on the drawing as one would expect rather than on the physical terminals as is happening but that may just be me … As well schematic doesn’t align to the grid.

I like ugly… and I won’t even ask what you are trying to do…

Even though you didn’t ask :slight_smile: : connect wires to the relay. As you see the result isn’t exactly intuitive for the newby. I’m of the thought that having the breadboard wires connect to the silkscreen connection circles on the part would be a lot better than to the real physical terminals as at present. Coming at this cold (without having drawn it :slight_smile: ) I’d have a hard time figuring out what the connections actually do.

In real life you can’t plug that into a BB - it has a socket -, it has to be with wires. The only thing is that the pins look a bit thick and hard to see.

I know about as much now as i did before I didn’t ask… :confused:

Isn’t that the whole point of BB view, real life, so that it can be made by beginners in real life.

The SCH is in SCH view so no need to duplicate it again in BB view.

I guess you can argue it either way. I’d prefer to see the pins come out where the numbers are (one coil connection at 86 with the terminal at the dot another (the wire currently connected in the middle of the part) on 85. The wire beside 87A actually on the silk for 87A and the wire to the right side connected to 87. Which follows the function of the part which (to my mind at least0 the current connections don’t even though they are probably physically accurate. This whole discussion started because the original poster is trying to modify this part to have more contacts and is having problems of some kind (what kind I’m not entirely sure of because there hasn’t yet been a part posted as far as I know).

Don’t know what happened, I have just typed war and peace and it suddenly disappeared? I will try again.
I am not sure if this will be the actual part but please let me know if it is.
4wayrelay.fzpz (11.4 KB)
Does that show up as the part?
All I have done is copy the contacts, invert two of them and then stitch it all together, I tried to widen the part but all that showed up was the bit in front of the dotted square?

That is what I am wanting. I can then use it on the breadboard and draw out what we already have as an aid memoire.
I tried to put the contacts behind each of the silkscreen contacts but it failed to move to Fritzing when I saved it, I stopped in the ealy hours of the morning and haven’t had time to return to it. I think I will get it if I persevere.

1 Like

Yep that is the part. I see where your problems lie (not enough terminals defined and not on the grid properly mostly) so I’ll fix up a copy and explain how I did it and we can go from there.

OK so here is what I did to get from your part to this (mostly) corrected one that I believe does what you want at least in breadboard:

First define my pins

connector0pin/terminal relay coil pin 13
connector1pin/terminal relay coil pin 14
connector2pin/terminal relay contact 9
connector3pin/terminal relay contact 1
connector4pin/terminal relay contact 5
connector5pin/terminal relay contact 10
connector6pin/terminal relay contact 2
connector7pin/terminal relay contact 6
connector8pin/terminal relay contact 11
connector9pin/terminal relay contact 3
connector10pin/terminal relay contact 7
connector11pin/terminal relay contact 12
connector12pin/terminal relay contact 4
connector13pin/terminal relay contact 8

Next fix up my view box to align with the grid. View->Page Grid to enable the grid if you haven’t

current:

height: 95.669289
width: 95.669289

no viewboz defined.

Change that to:

(in xml editor click on the very top line svg id=0)

height: 1in set
width: 1in set
viewBox 0 0 100 100

(to set the view box, enter viewBox in the panel beside the set button then in the window below
enter

0 0 100 100

and click set to set it.

Next put the pin end points on the drawing on .1 grid lines.

so click on the black background and drag it aside to expose the various pads.

starting with the pad on terminal 13 drag the oval for the pad (path3875-9) til it is centered on the first pair of major grid lines. Do the same for all the rest of the pads til the pattern matches the new svg. Note while doing this that path path3547 is missing its oval. So click on path3875-5-7 (the oval beside this pin) and in xml editor click duplicate node to make a copy. Now drag the oval over one pin to be on path3547. While adjusting the pins we are also going to rename them all according to the list that started this post. So for the oval on pin 13 (path3875-9) select it with cntrl-left mouse click and in xml editor select id then change path3875-9 to connector0pin and click set to set it. Now select the pad around the oval (path3524) and set its id to connector0terminal. Repeat these steps with all the rest of the pins setting them according to the list above. Now click on the black background and drag it back over the pins. You will see the white lines are now in the wrong position and need adjusting (since they won’t affect the operation I haven’t bothered to correct them). At this point I saved the breadboard svg as plain svg and exited Inkscape as the bb svg is done (you probably want to readjust the white line so they match the pins not being lazy like me :slight_smile: ). Now we need to edit the fpz file with a text editor (I use vi, but notepad should work I think) Basically we need to add all those connectors that we put in the bb svg. In the fpz file you are looking for the lines like this:
(note there should be an opening bracket at the start of the line but this web software doesn’t let me enter it …)
connectors>
connector id=“connector4” name=“86” type=“male”>
description>Relay Coil - Pin 2
views>
breadboardView>
p layer=“breadboard” svgId=“connector4pin”/>
/breadboardView>
schematicView>
p layer=“schematic” svgId=“connector4pin” terminalId=“connector4terminal”/>
/schematicView>
pcbView>
p layer=“copper0” svgId=“connector4pin”/>
p layer=“copper1” svgId=“connector4pin”/>
/pcbView>
/views>
/connector>

I prefer to have them in pin number order so I know I haven’t missed a pin (but Fritzing doesn’treally care about the order as long as they are all there). So first move the ones that arethere in to numberical order. While its probably not hurting anything, you aren’t using busses so delete the bus section:

buses>
bus id=“bus0”>
nodeMember connectorId=“connector2”/>
/bus>
/buses>

I then moved pins 4 and 5 to below pin 2. Note pin3 is missing completely. so copy one of the others in to the slot for pin3 and rename it to connector3. Then after connector5 duplicate enough copies of the connector above to make pins 6 through 13 as well. Now we need to adjust each pin in turn. First we need to correct the description to match your part so change:

connector id=“connector0” name=“87A” type=“male”>
description>Switch Terminal ‘A’

to

connector id=“connector0” name=“13” type=“male”>
description>Coil Terminal 1

where the name becomes the pin number on your part and the description is what the pin does. then we need to add the connectorxterminal to breadboard so change

  p layer="breadboard" svgId="connector0pin"/>

to

  p layer="breadboard" terminalId="connector0terminal" svgId="connector0pin"/>

and repeat for the other 12 pins. While you are here its good practice to check that all the pin numbers match (so the first one should all be 0 and the second all 1 etc.). Typos here will cause problems that can be hard to find. Hope this helps, ask questions if it doesn’t.

corrected_4wayrelay.fzpz (11.4 KB)

corrected_4wayrelay.fzpz (11.7 KB)

vanepp that is brilliant, thank you so much.
You are right about my requirement for the contacts. I have moved the pads around so they are over each pin and it works perfectly.
What I then have to do is change the suffix of the ‘corrected_4wayrelay.fzpz’ to ‘corrected_4wayrelay…zip.’ This allows me to open it as a zip file and get at the files
part.4wayrelay_35157 etc
svg.breadboard.4wayrelay_35157 etc
svg.icon.4wayrelay_35157 etc
svg.pcb.4wayrelay_35157 etc
and
svg.schematic.4wayrelay_35157 etc

I then open
‘part.4wayrelay_35157 etc.’
in notepad and find
moduleId=“4wayrelay_35157ff6d6f48da00b0a28d5dbaca431_10”
which is about 100 characters in. I then alter the last number, now 10 to the next number i.e. 11 otherwise fritzing says it already has that part in when I import it.
I now delete the zip file and zip all the above files into a new
‘corrected_4wayrelay…zip.’ alter the suffix to fzpz so I have
‘corrected_4wayrelay…fzpz’ and then import it into fritzing.
Do you know how I can stop fritzing recognising the fact that I have all those copies in?

Assuming you are on Windows, as noted in the howto 7zip will unzip an fzpz file if you right click on it and click 7zip extract here (without having to rename the file to .zip) and happily rezip it to an fzpz file if you change the name it suggests to store the archive to to fzpz. In theory you should be able to change the name and sequence numbers of the files to anything unique, in practice when I have tried that it loads fine in to fritzting but sometimes will break when you make a change with parts editor and store it. So for now I usually let Fritzing set the file names it likes until I get time (and a source code level debug environment) to see why it is unhappy about what I think should be valid file names. Bottom line, I don’t currently have a solution. Glad the modified part worked for you. As far as I know parts editor can’t add new terminals, the original has to have sufficient terminals for the part (but as always I could be wrong there :slight_smile: ).

I am not adding ‘new’ terminals , you added them, I assume, with inkscape. I moved them back to inkscape and just moved the teminals around to fit the contacts on the silk screen.
I will have to try your 7.zip the next time I do it.
It knows I have altered the file name 'cos it remembers it and tells me it is already there if I try to load "an altered " file. Do you know where it stores this info so I could clear it and use the numbers from 1 again?

I added them to the fpz file with a text editor and both Inkscape and Frtizing take them from there. I’m not sure exactly where Fritzing stores the numbers, I think it is in a database file somewhere. If you don’t mind losing all the context you can delete the two user data files and start again which will reset all the numbers. On windows they are in

C;\Users\User_name\AppData\roaming\Fritzing and
c:\Users\user_name\My Documents\Fritizing

(where user_name is your windows user name). The AppData one is a hidden file so you need to enable show hidden files in explorer to see it. If you delete both directories Fritzing will recreate them when it starts with no memory of any part numbers. I do this fairly often (by moving both directories to a different file name usually so I don’ t lose all the current parts) as it is possible to hang Fritzing if you screw up editing the files badly enough and then the only cure is to delete those two directories. Once you have the part running correctly move the saved directories back to the original file names and add your now stable part.