Illustrator to LightBurn directly (like CorelDraw macro)

Is it possible to make macro, plugin or button for Illustrator which converts whole drawing to curves and then somehow programatically force LightBurn to import that file with correct layer colors and dimensions (like CorelDraw macro). Of course, all process is done in background, so user don’t see that conversion…etc.

Thank you in advance for your help.

Here is the instructions I used to export directly to Lightburn

  1. Create “OpenExternal.vbs” in “C:\Lightburn_data” (create folder if it doesn’t exist)
  2. Code for “OpenExternal.vbs”
    Dim oShell
    Set oShell = WScript.CreateObject (“WScript.Shell”)
    oShell.run “”“C:\Program Files\Lightburn\Lightburn.exe”" ““C:\Lightburn_data\export.svg”” "
  3. Create “SaveDocsAsSVG_Lightburn.jsx” in “C:\Program Files\Adobe\Adobe Illustrator CC
    2014\Presets\en_US\Scripts” or equivalent folder
  4. Code for ““SaveDocsAsSVG_Lightburn.jsx”
    try {
    if (app.documents.length > 0 ) {
    var destFolder = null;
    destFolder = “C://Lightburn_data//”;
    if (destFolder != null) {
    var options, i, sourceDoc, targetFile;
    options = this.getOptions();
    for ( i = 0; i < app.documents.length; i++ ) {
    sourceDoc = app.documents[i];
    targetFile = this.getTargetFile(‘export’, ‘.svg’, destFolder);
    sourceDoc.exportFile(targetFile, ExportType.SVG, options);
    }
    var vbFile = new File(“C:\Lightburn_data\OpenExternal.vbs”)
    vbFile.execute();
    }
    }
    else{
    throw new Error(‘There are no document open!’);
    }
    }
    catch(e) {
    alert( e.message, “Script Alert”, true);
    }
    function getOptions()
    {
    var options = new ExportOptionsSVG();
    return options;
    }
    function getTargetFile(docName, ext, destFolder) {
    var newName = “”;
    if (docName.indexOf(’.’) < 0) {
    newName = docName + ext;
    } else {
    var dot = docName.lastIndexOf(’.’);
    newName += docName.substring(0, dot);
    newName += ext;
    }
    var myFile = new File( destFolder + ‘/’ + newName );
    if (myFile.open(“w”)) {
    myFile.close();
    }
    else {
    throw new Error(‘Access is denied’);
    }
    return myFile;
    }
  5. Script is available within Illustrator from "File->Scripts

David, if you already have this set up and working, there’s a change that can make it smoother. LightBurn includes a small helper app for things like this that will check to see if LightBurn is already running, and if so, will import the file into the existing instance of LightBurn instead of launching a new one.

Instead of doing this:

oShell.run """C:\Program Files\Lightburn\Lightburn.exe"" ""C:\Lightburn_data\export.svg"" "

Do this instead:

oShell.run """C:\Program Files\Lightburn\SendUDP.exe"" ""C:\Lightburn_data\export.svg"" "

That’s the only change you should need.

It’s possible, yes, I just don’t have Illustrator to create or test this with, but it’s on the list to do.

The “with correct layer colors” part is trickier - the palette in LightBurn is fixed. Imported art is mapped to the closest color in the LightBurn palette, but the LightBurn palette won’t change to match. It’s done this way because lots of artwork contains white, used to paint over things you don’t want, and those wouldn’t show up in the LightBurn workspace.

Thanks Oz,
I will make the change. I haven’t used it for awhile.
David

Hi David,

Thank you!
I tried it, but this method can only saving the graphics into an .svg file for me.
I rewrote “LightBurn.exe” to “SendUDP.exe” in the .vbs code (as OZ suggested), but it won’t open LighBurn too. I fixed the syntax errors and checked the filepaths. Seemingly everything is fine, but it doesn’t work. The “export.svg” file is get ready but LightBurn will not open.

What could be the problem?

OZ:
Okay. It is not problem. The only important thing is that LightBurn recognizes Illustrators different colors in differently.
Thank you!