Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

Export to AutoCAD error

$
0
0

Hi everybody,

maybe here is anyone that can help me with my problem, because I've no idea, where my mistake is.

 

I tried to use a script (JavaScript) to automatically export each layer of an Illustrator file. The desired file format is AutoCAD, which shall not be a problem, because manual exporting works fine.

 

So my approach was hiding all layers except one and then export the file with the document.exportFile()-method. This exportFile()-method works with all other formats like svg, png or jpg, but when I try to call the method with an ExportOptionsAutoCad-argument, i receive the following error message:

Error 1320: Invalid enumeration value

Line: 25

->

document.exportFile(file,ExportType.AutoCAD,options);

 

So here is the crucial code of my script, I hope anyone of you has an idea, why this script isn't working.

 

Thank you!

if(document && folder)
{          var options = new ExportOptionsAutoCAD();     options.colors = AutoCADColors.TrueColors;     options.rasterFormat = AutoCADRasterFormat.PNG;     options.unit = AutoCADUnit.Millimeters;     options.version = AutoCADCompatibility.AutoCADRelease18;          var n = document.layers.length;     for(var i=0; i<n; ++i)     {          hideAllLayers();          var layer = document.layers[i];          layer.visible = true;               var file = new File(folder.fsName+"/"+layer.name+".dwg");          document.exportFile(file,ExportType.AutoCAD, options);          }          showAllLayers();
}

Viewing all articles
Browse latest Browse all 12845

Trending Articles