KiCad "undefined DRAW command #" error. - Page 1
Forum section: electronics / general

author: firewalker
author_rank: Super Contributor
timestamp: December 19, 2011, 10:00:59 am
content: Does anyone faces the "undefined DRAW command #" error when importing converted libraries form EAGLE? It happens to the new versions o KiCad.Alexander.

author: amspire
author_rank: Super Contributor
timestamp: December 19, 2011, 11:19:12 am
content: I haven't tried it yet, but if you know the file with the problem, look at the line number in question.The first character in the line sets the type of DRAW command. The latest KiCad eeschema allows for types "A" (Arc), "C" (Circle), "T" (Text), "S" (Square), "X" (Pin Description), "P" (Polyline), and "B" (Bezier Curve).If it is none of these you get the error message.Some builds lost the Bezier curve ("B") option, but I know the latest build I posted in the forum does have it.Richard.

author: firewalker
author_rank: Super Contributor
timestamp: December 19, 2011, 11:39:02 am
content: For example the relay library (http://library.oshec.org/compressed/relay.tar.gz).QuoteThe as I can understand the problem occurs with multi part components like G2R.(image from EAGLE)There are hundreds of errors for the relay lib.Deleting the two lines makes the component to appear in the lib browser but only the first part of it.

author: amspire
author_rank: Super Contributor
timestamp: December 19, 2011, 12:26:07 pm
content: The eeschema library load does not allow for lines beginning with "#" between the DRAW and ENDRAW statements in the lib file.It may need a change to the Eagle export script. I don't know enough about it to say if it is an easy fix or a difficult one.I guess the thing to do would be to look at the lib format for another multipart component such as a LM324 quad opamp and see how multipart components should be handled.Richard

author: amspire
author_rank: Super Contributor
timestamp: December 19, 2011, 12:41:55 pm
content: I just discovered that this is how eeschema handles multipart components.It always installs the first component part (Part A), which in the case of this relay is the coil. So just add it twice.Right click on the second one and go to Edit->Unit and change it from Unit 1A to Unit 2BWhen you give the component a designation, it will add an "A" to the end of the part A item (the coil) and a "B" to the end of the part B item (the contacts).So if you called it Rel01, you would end up with Rel01A and Rel01B.It seems you can safely delete the stuff starting with "#" inside the DRAW section.Richard

author: firewalker
author_rank: Super Contributor
timestamp: December 19, 2011, 01:11:13 pm
content: Yep. That seams to do the trick. I will probably write a bash script converter.My big complaint with KiCad is that there is no properly organized community in proper forum format. Maybe just here.Alexander.

author: amspire
author_rank: Super Contributor
timestamp: December 19, 2011, 01:17:57 pm
content: It would probably be better to change the Eagle Export script so it never puts lines beginning with "#" between DRAW and ENDDRAW.I haven't really looked for KiCad forums. There ishttp://tech.groups.yahoo.com/group/kicad-users/messages

author: rennne
author_rank: Newbie
timestamp: January 01, 2012, 01:31:53 pm
content: Use the script: eagle2kicad-0.9d.ulp to convert libs form eagleit works fine .. you can download it under:http://www.modulbot.com/download.htmlIf you want to modify it manualy use a "Regular Expression"-Editor:"Find and Replace" -># Gate Name:.*$and# Symbol Name:.*$Replace it with nothingEmpty lines are left instead .. kicad does not want that eitherso again Find and Replace ..\r\rreplace all with nothing ... then the empty lines where gone and kicad workes fine with it