Author Topic: Problem Gerber File  (Read 26001 times)

Offline CScotty

  • Droid
  • **
  • Posts: 56
    • View Profile
Problem Gerber File
« on: October 28, 2022, 11:15:29 am »
I'm getting "input string was not in a correct format" error when reading the attached.

Ok with all other gerber viewer I've tried.

I can't find a log file that might give more info to narrow it down.

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5319
  • Made in England
    • View Profile
Re: Problem Gerber File
« Reply #1 on: October 28, 2022, 13:01:57 pm »
It may be that you saved the file in a more recent format that CamBam is unable to process. Try saving in an older format if that is possible.

It also seems you've had similar issues in the past, https://cambamcnc.com/forum/index.php?topic=8843.msg70283#msg70283
« Last Edit: October 28, 2022, 13:27:53 pm by EddyCurrent »
Filmed in Supermarionation

Offline CScotty

  • Droid
  • **
  • Posts: 56
    • View Profile
Re: Problem Gerber File
« Reply #2 on: October 28, 2022, 17:06:50 pm »
Yes, gerber issues with cambam is a recurring theme.

This is is different as it won't import it all. As previously mentioned trying without X2 enabled doesn't help.

Is there an error log file anywhere? If the message had the line number it would help.

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5319
  • Made in England
    • View Profile
Re: Problem Gerber File
« Reply #3 on: October 28, 2022, 18:50:18 pm »
The error log can be found here; C:\ProgramData\CamBam plus 1.0\cbdebug.log
Filmed in Supermarionation

Offline CScotty

  • Droid
  • **
  • Posts: 56
    • View Profile
Re: Problem Gerber File
« Reply #4 on: October 28, 2022, 19:15:55 pm »
I had previously seen mention of that log in the docs but it does not exist, at least in my cambam folder, see attached.





Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5319
  • Made in England
    • View Profile
Re: Problem Gerber File
« Reply #5 on: October 28, 2022, 20:52:43 pm »
You are in the wrong place, follow the path I wrote.
Filmed in Supermarionation

Offline CScotty

  • Droid
  • **
  • Posts: 56
    • View Profile
Re: Problem Gerber File
« Reply #6 on: October 29, 2022, 09:18:23 am »
Opps.. So I did. Sorry!

Well it doesn't give a line number but I does point me to a macro "AM" issue.

Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at System.Int32.Parse(String s)
   at CamBam.CAD.Gerber_ApertureMacro.BuildShape(Double[] Modifiers)
   at CamBam.CAD.Gerber_ApertureDefinition.BuildShape(GerberFile parent)
   at CamBam.CAD.GerberFile.a3Cp8RU0g9(Gerber_ApertureDefinition )
   at CamBam.CAD.GerberFile.AddToDocument(CADFile doc)
   at CamBam.UI.CamBamUI._OpenFileWorker()


The only macro is this:

%AMRoundRect*
0 Rectangle with rounded corners*
0 $1 Rounding radius*
0 $2 $3 $4 $5 $6 $7 $8 $9 X,Y pos of 4 corners*
0 Add a 4 corners polygon primitive as box body*
4,1,4,$2,$3,$4,$5,$6,$7,$8,$9,$2,$3,0*
0 Add four circle primitives for the rounded corners*
1,1,$1+$1,$2,$3*
1,1,$1+$1,$4,$5*
1,1,$1+$1,$6,$7*
1,1,$1+$1,$8,$9*
0 Add four rect primitives between the rounded corners*
20,1,$1+$1,$2,$3,$4,$5,0*
20,1,$1+$1,$4,$5,$6,$7,0*
20,1,$1+$1,$6,$7,$8,$9,0*
20,1,$1+$1,$8,$9,$2,$3,0*%


The AD for it is this:

%ADD12RoundRect,0.250000X-0.600000X-0.600000X0.600000X-0.600000X0.600000X0.600000X-0.600000X0.600000X0.0*%


If I remove the entire ADD12RoundRect line I can read the file OK so that seems to be where the problem is.
 
That seems to have 10 parameters when it should have 9.  This is new to me so I'm not too sure about that. If I remove the extra "X0" at the end it doesn't help so that is not the problem.

Can you see anything wrong with it? If not does that mean the cambam parser is the problem?

PS: I removed the macro and replaced the AD12RoundRect with

%ADD12R,1.4500000X-1.4500000X0*%


Now I can import.

I'd consider this  a bug.


« Last Edit: October 29, 2022, 18:25:27 pm by CScotty »