Script based Gerber and ODB data generation

Script based Gerber and ODB data generation

m.neumair
Contributor Contributor
522 Views
9 Replies
Message 1 of 10

Script based Gerber and ODB data generation

m.neumair
Contributor
Contributor

Hello community,

 

we're facing some problems during our migration from EAGLE to Fusion. We were able to generate gerber data in EAGLE with some very simple commands from a batch file, e.g.:

"%EAGLEPATH%\eaglecon.exe" -c- -X -dGERBER_RS274X -o"Gerberdaten"/%Project%.cmp %Project%.brd 1 VIAS PADS

 

I tried to find an equivalent in Fusion. By now, the best way for me is to start an ULP that executes the following:

set confirm yes;manufacturing export <path>/<filename>.zip <path>/<jobname>.cam;

 

Anyway this causes the following pain:

- I have to create separate CAM-jobs for all used amounts of layers (we had a standard set of gerber commands before on EAGLE)

- The ODB++ data is not exported if I call the CAM-processor from the script. If I start the same job from the GUI, I get ODB++ data...

- The images are not exported if I call the CAM-processor from the script. If I start the same job from the GUI, I get the layer images...

- Using the CAM processor from the script only works if I define a zip archive as the destination. As this data is part of our release data, I have to unpack it afterwards. I'd like to get rid of this step and simply export it to a given directory...

 

Can someone tell me how to solve all or at least some of these issues?

 

Best regards,

Markus

0 Likes
Accepted solutions (2)
523 Views
9 Replies
Replies (9)
Message 2 of 10

jorge_garcia
Autodesk
Autodesk

Hello @m.neumair ,

 

I hope you're doing well. So there is currently no headless setup for Fusion that would allow a batch script like this to be run. I'll add this thread to the existing ticket for this functionality.

 

For now the method you are using would be the way.

 

1) Nothing we can improve here, you will need a different CAM job for each layer stackup you try to use.

2) This sounds like a bug, if the CAM job incorporates ODB++ output it should be outputted.

3)I'll look into this, it feels like it should work the same regardless of what you save the files to.

 

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 3 of 10

constantin.popescuXD3CL
Autodesk
Autodesk

Hi @m.neumair Markus,

What you need can be done already. The main difference compared with your Eagle setup is that Fusion is using the CAMJOB to convey the output setup. The 2nd difference is the presence of ODB++ manufacturing outout that will be exported on its own. The rfeason for this is that ODB++ dataset contains all the design data that would be exported if: Gerber, NC Drill, IPC-356-D netlist would be expoprted together.

You can achieve what you want using the following CLI commands:

set confirm yes;manufacturing export <outputDirectory> automation <camjobfilePath>.cam;

set confirm yes;manufacturing odb <outputDirectory> automation <camjobfilePath>.cam;

We used these commands to implement our CAM automation regression test suites and they work well. Using the automation flag among other things it will ensure that when using the export flag no ZIP file is created. In the custom CAMJOB you can specify if you want the ODB++ output to be compressed or not. This is done by using the JSON key: "compress_output" in the "outputs" section for the ODB++ (the ODB++ output JSON setup is 1st in the list of outputs). If you don't want the ODB++ output to be compressed then set the "compress_output" to false (in the template CAMJOB files this is set to true). This is an example of the ODB++ output JSON header information:

            "compress_output": true,
            "export_cad_netlist": true,
            "export_eda_component_attributes": true,
            "export_eda_data": true,
            "export_eda_footprint_names": true,
            "export_eda_net_attributes": true,
            "export_job_name_instead_of_product_model_name": true,
            "export_layer_features_count": true,
            "export_neutral_net_names": false,
            "export_step_profile_board_cutouts": true,
            "export_step_profile_from_board_shape": true,
            "export_unique_id": true,
            "export_unit": true,
            "filename_prefix": "CAMOutputs/ODBFiles",
            "generate_job_file": false,
            "odb_format_version": "V8.1+",
            "output_name": "odb-2layer-arduino",
            "output_type": "odb++",

I hope this helps.

Please let me know how you go with this.

 

Kind Regards,



Constantin Popescu
Principal Software Engineer
Message 4 of 10

m.neumair
Contributor
Contributor

Hello @constantin.popescuXD3CL  Constantin,

 

thank you very much for these commands. Why aren't they part of the autodesk docu?

 

I tried three things:

1) Open my jobfile in the GUI and press 'Process job'. All files are generated as expected. 

2) Execute set confirm yes;manufacturing export <outputDirectory> automation <camjobfilePath>.cam;

This generates the expected gerber and drill data. Anyway, it also creates the odb-folder and a subset of the odb data (e.g. matrix and the content of steps/pcb/eda are missing)?! Can I supress generating the odb folder for this command? The Images are not generated for this command - is it possible to get them here?

3) Execute set confirm yes;manufacturing odb <outputDirectory> automation <camjobfilePath>.cam;

This generates the ODB data but places it in a 2 layered subfolder structure named like the CAM job (e.g. '\template_2_layer\template_2_layer.odb'). Not cool for further automated processing. Gerber data and images are also generated and placed in the top odb folder (next to the fonts and matrix folders..., this does not happen if i use the autodesk template...). For some reason it also produces drill data, but in the correct directory like in step 2). 

 

Can you please clarify the mentioned issues? Is there a way to simply generate exactly the same as if I press 'Process job' inside the CAM job editor of the GUI?

 

Best regards,

Markus

0 Likes
Message 5 of 10

constantin.popescuXD3CL
Autodesk
Autodesk

Hi @m.neumair Markus,

Regarding your above points, here are my answers:

2. Execute set confirm yes;manufacturing export <outputDirectory> automation <camjobfilePath>.cam; - the ODB++ data is generated alongside Gerber / NC Drill, etc. because you have used a CAMJOB file that contains both. The easiest solution is to split your CAMJOB file into 2. For Gerber, NC Drill output please completely remove the ODB++ section, look for "output_type": "odb++" and remove the entire JSON section, starts with { and the 1st JSON key is "compress_output" and ends with }. In order to get the IMAGE section you'll need to configure it. I would suggest to open your design in Fusion and go to CAM Processor and update the Image output with the configuration you require. Save the CAMJOB and then open the JSON file in any text editor (preferanly one that can read JSON format) and copy the IMAGE section into the output-gbr_drill.cam CAMJOB (see below), save and you should be good to go. The CLI command to start with should be: "set confirm yes;manufacturing export 'output_directory/output' automation 'output_directory/output-gbr_drill.cam';". Use the attached output-gbr_drill.cam CAMJOB file to start with. This command will generate the CAM outputs in the following directories: output/output.gbr and output/output.drl, You can change the name of  the CAMJOB output-gbr_drill.cam to something else if you want to.

3. Execute set confirm yes;manufacturing odb <outputDirectory> automation <camjobfilePath>.cam; - same as above remove all other outputs from the CAMJOB JSON apart from ODB++. Use the attached CAMJOB output.cam as a starting point (this CAMJOB is for a 2 layer board so it needs to be adjusted accordingly). The CLI command to start with should be: "set confirm yes;manufacturing odb 'output_directory' automation 'output_directory/output.cam';". This command will generate the CAM ODB++ output in the following directory: output/output.odb. The CAMJOB file for the ODB++ output should always be named output.cam if you want all the CAM outputs to be generated in the same output top level directory.

I have attached:

  1. A ZIP file CAMJOBs.zip that contains: output.cam, (ODB++) and output-gbr_drill.cam (gerber + NC Drill);
  2. Snapshot of output directory that I have generated locally:

constantinpopescuXD3CL_0-1769493709029.png

 

This is the best workaround I could come up with because right now there are some missing extensability points in the manufacture CLI command. I hope this helps. 

 

Kind Regards,



Constantin Popescu
Principal Software Engineer
0 Likes
Message 6 of 10

m.neumair
Contributor
Contributor

Hi @constantin.popescuXD3CL Constantin,

 

regarding the two discussed points:

2) Gerber data looks good now after removing the other parts from the CAM job. Anyway, I do not get images after adding them in json if I execute set confirm yes;manufacturing export <outputDirectory> automation <camjobfilePath>.cam; I do not even get the images if I do as you specified - starting with output-gbr_rill.cam and using the specified folder structure. Are you sure that the image export works on your machine, There is no corresponding output folder in your screenshot?

3)  The configured compressed ODB++ output is missing (not that relevant), the rest of the files seems to be present. Anyway, the folder structure does not match the configured one and your workaround is no really an alternative. I would need a cam job for any layer set (2, 4, ...) and obviously they cannot all have the same name...

 

My absolute minimum requirements (gerber and drill files in a certain folder) are fulfilled. That's good. 

The next priority would be getting the odb data in the correct folder (independent from the cam filename or cam filepath). Is there a timeline for the missing extensability points in the manufacture CLI command?

A nice to have would be the images inside the specified output folder on gerber generation. Can you please check if this is working on your machine?

 

Best regards,

Markus

 

 

 

 

0 Likes
Message 7 of 10

constantin.popescuXD3CL
Autodesk
Autodesk

Hi @m.neumair Markus,

I thought that the Image / Pdf export will also worked trough the CLI but unfortunately I was wrong. Currently the manufacture export command only supports: Gerber, NC Drill, Assembly and Drawing outputs. This is a bug that was not discovered until now. I have made a change to allow all the outputs that are present in the CAMJOB to be exported not only the ones mentioned above. I will let you know when this update is available. In the meantime it is not possible to generate the Image output using the manufacture export command.

"3)  The configured compressed ODB++ output is missing (not that relevant), the rest of the files seems to be present. Anyway, the folder structure does not match the configured one and your workaround is no really an alternative. I would need a cam job for any layer set (2, 4, ...) and obviously they cannot all have the same name..." - the compressed output is missing because this is turned off when the automation flag is present (compressed output and automation are exclusive). Do you need the compressed output as well? The root folder is indeed tied to the CAMJOB's name when the automation flag is used. Without the automation flag you'll get a ZIP file which is also undesirable. I will add a task to implement these missing features as soon as possible.

"The next priority would be getting the odb data in the correct folder (independent from the cam filename or cam filepath). Is there a timeline for the missing extensability points in the manufacture CLI command?" - there is no timeline right now but I will add a change request and mark it is Critical so we can get to it as soon as possible.

 

I hope this helps.

 

Kind regards,



Constantin Popescu
Principal Software Engineer
Message 8 of 10

Accepted solution

Hi @m.neumair Markus,

I have implemented the changes that I have mentioned above so now you should be able to use the manufacturing export or manufacturing odb to generate all the CAM outputs you need. The difference between this 2 commands is that the ODB++ one should only be used when only ODB++ is required but not Gerber and NC Drill.

The updated CAM CLI commands are as follows:

  • Manufacturing export:
manufacturing export '<output_directory>' automation all_outputs create_directories '<export_camjob_file.cam>';

Where:

  • <output_directory> - the root output directory where the CAM output will be stored;
  • automation - manadatory flag, run the CAM automation workflow;
  • all_outputs - manadatory flag, generate all outputs that are configured in the supplied CAMJOB file;
  • create_directories - mandatory flag, when present, force create all directories that are required to store the generated CAM outputs;
  • <export_camjob_file.cam> - the full file path for the CAMJOB that contains the configuration for all the outputs that need to be generated, any of: ODB++, Gerber, NC Drill, Assembly, Drawings, Image / PDF;
  • ODB++ export:
manufacturing odb '<output_directory>' automation no_camjob_override '<odb_camjob_file.cam>';

Where:

  • <output_directory> - the root output directory where the CAM output will be stored;
  • automation - manadatory flag, run the CAM automation workflow;
  • no_camjob_overridedo not override any of the supplied CAMJOB's ODB++ attributes (this is required because the default automation flag behaviour is to override some of the CAMJOB JSON attributes);
  • <odb_camjob_file.cam> - the full file path for the CAMJOB that contains the configuration for the ODB++Assembly, Drawings and Image / PDF outputs; (ODB+ already contains all the information that Gerber and NC Drill outputs contain and should not be configured here);

Example CLI commands:

set confirm yes;manufacturing export '<RootDir>/Outputs' automation all_outputs create_directories '<RootDir>/output-export.cam';
set confirm yes;manufacturing odb '<RootDir>/Outputs' automation no_camjob_override '<RootDir>/output-odb.cam';

I have attached 2 CAMJOB template configuration files that you can use as starting point. These are for a 2 layers board. If you let me know what type of designs you are making then I can help you with suitable CAMJOB files. The CAMJOBs are as follows:

  • output-export.cam - should be used when using the manufacturing export command and it contains all 6 supported CAM outputs;
  • output-odb.cam - should be used when using the manufacturing odb command and it contains only 4 CAM outputs;

These changes will be available in the next major Fusion360 update. If you are a Fusion Insider then you would be able to start using these changes as soon as the next Fusion Insider release build is available. If you are not a Fusion Insider and you'd like to be a part of it then you can apply here: https://feedback.autodesk.com/key/fusion360insider-AdskFusionProductTeam

I will post back when these changes are available to use.

I hope you'll find these updates useful.

 

Kind Regards,



Constantin Popescu
Principal Software Engineer
Message 9 of 10

Accepted solution

Hi @m.neumair Markus,

Just a heads up the changes that I talked about in my previous post have been released in todays Fusion Insiders Build 2701.0.70 so if you are altready an Insider or you want to be a part of it then you can go ahead and test these changes and please let me know if it helps you with your batch CAM workflow.

Thanks a Lot.

 

Kind Regards,  



Constantin Popescu
Principal Software Engineer
0 Likes
Message 10 of 10

m.neumair
Contributor
Contributor

Hi @constantin.popescuXD3CL ,

 

looks good - the open issues seem to be fixed.

 

Thanks for your support,

Markus

 

0 Likes