what you are doing is quite complicated, because you want to write a file which syntax you do not know exactly.
My proposal would be to write a gerger creation script directly. The you manage, wich elements of the pcb you want to write in each file.
I can not provide our files, but you should have a look into attached RunGerber.vbs (from installation directory C:\Mentor\2007.7EE\SDD_HOME\standard\examples\pcb\Automation\AutoProEngines)
It needs an automation pro license!
Additionally you can look into Kendalls AutoActive Toolkit .
This way would give you much more control about the content of the files.
RunGerber.zip 2.5 KB
Thank you; I am looking into it. Do you have any example with the GerberEngine inside a VB6 project? It would be nice to use it there because I already have available all the information from the design such as filenames, selected user layers to gerber out, plane layers and so on. If I run the RunGerber.vbs not only will I have to supply that file with the install, but every user will need access to Automation Pro (which won't always be the case) and I'll have to pass all the information from various arrays and variables into the vbs to make it work correctly.
Thanks again for your suggestion - now just how to implement it smoothly.
I was writing the file in Unicode format instead of ASCII.
Set ts = f1.OpenAsTextStream(ForWriting, True)
Set ts = f1.OpenAsTextStream(ForWriting, False)
does the trick.
I'm still looking into using the Gerber Engines as part of a tool running alongside Expedition instead of just in a vbscript. If anyone has an example of how this is done please share it.