Help with drill file

Help with drill file

richjmaynard
Contributor Contributor
950 Views
5 Replies
Message 1 of 6

Help with drill file

richjmaynard
Contributor
Contributor

Hello,

 

Can anyone tell me why this PCB design

 

rich_0-1590153221925.png

 

Gives me this drill file in FlatCAM?

rich_1-1590153356881.png

 

The hole positions are nearly right, but nearly half of them are displaced off to the side.

 

Help!

 

 

0 Likes
Accepted solutions (1)
951 Views
5 Replies
Replies (5)
Message 2 of 6

jorge_garcia
Autodesk
Autodesk
Accepted solution
Hello @Anonymous,

I hope you're doing well. The first thing I would recommend to check is in the program where you are checking the drill file make sure that you specify the format of the drill file. If you don't specify the format of the file the program will take a guess and most of the time they guess correctly but sometimes they don't.

The drill file outputted from Fusion is 3.3 Leading zeroes supressed absolute metric.

Let me know if you continue to run into problems.

Best Regards,


Jorge Garcia
​Product Support Specialist for Fusion 360 and EAGLE

Kudos are much appreciated if the information I have shared is helpful to you and/or others.

Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.
Message 3 of 6

richjmaynard
Contributor
Contributor

Yes! That seems to have fixed it. Thank you!

0 Likes
Message 4 of 6

matt-wall
Community Visitor
Community Visitor

Is there a way to set the file to not suppress the leading zero's? I have to manually add them back in currently in a text editor prior to loading to the CAM as my CAM can only work with the zero's in place and this can be a torturous exercise.

0 Likes
Message 5 of 6

jorge_garcia
Autodesk
Autodesk

Hi @matt-wall ,

 

I hope you're doing well. Unfortunately, we don't have any mechanism to expose the leading zeroes. We have always used a leading zeroes suppressed file format. What CAM are you using? Most recent CAM software allows you to specify the format of the files. It could be the case that you can tell the CAM software that the leading zeroes are suppressed and continue working that way.

 

Let me know if there's anything else I can do for you.

 

Best Regards,



Jorge Garcia
​Product Support Specialist for Fusion 360 and EAGLE

Kudos are much appreciated if the information I have shared is helpful to you and/or others.

Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.
0 Likes
Message 6 of 6

formsR28H6
Enthusiast
Enthusiast

I faced the same problem.

 

Attached python script converts mine.

 

#!/usr/bin/env python3

import sys
import os

def convert_drill_file_final_adjustment(input_filename):
    output_data = []
    output_data.append("M48\n")
    output_data.append("INCH\n")
    output_data.append("T01C0.040\n")
    output_data.append("%\n")
    output_data.append("T01\n")  # Ensure T01 is added before coordinates

    # Read input data from the specified file
    with open(input_filename, 'r') as file:
        input_data = file.readlines()

    for line in input_data:
        line = line.strip()
        if line.startswith("X"):
            x_part, y_part = line.split("Y")
            # Convert to integer to remove any incorrect leading zeros, then format to required length
            x_val = f"{int(x_part[1:]):05d}" + "0"  # Convert to integer, 5 digits, add trailing zero
            y_val = f"{int(y_part):05d}" + "0"      # Convert to integer, 5 digits, add trailing zero
            output_data.append(f"X+{x_val}Y+{y_val}\n")
        elif line == "M30":
            output_data.append("T00\n")
            output_data.append("M30\n")
            break

    # Replace ".xln" with ".drill" in the output filename, or just add ".drill" if no ".xln" is present
    output_filename = input_filename.replace(".xln", "") + ".drill"
    with open(output_filename, 'w') as file:  # 'w' mode overwrites the file
        file.write(''.join(output_data))

    # Print output to the console
    print(''.join(output_data))

# Check if the script is called with an input filename argument
if len(sys.argv) != 2:
    print("Usage: python3 convert_drill.py <input_file>")
    sys.exit(1)

# Usage: take the input filename from command line argument
os.chdir(os.getcwd())
input_file = sys.argv[1]
convert_drill_file_final_adjustment(input_file)

 

 

0 Likes