Highlighted

Export Art as .ai file

Community Beginner ,
Sep 02, 2020

Copy link to clipboard

Copied

Hello there,

 

I'm actually trying to get the artSet and I want to write .ai file with it ! 

AIArtSet artSet = NULL;

error = sAIArtSet->NewArtSet(&artSet);

sAIArtSet->SelectedArtSet(artSet);


AIRasterizeSettings rastSettings;

AIArtHandle tempRaster = 0;

AIArtHandle layerGroup = 0;

error = sAIArtSet->IndexArtSet(artSet, 0, &layerGroup);

AIRealRect bounds;

error = sAIRasterize->ComputeArtBounds(artSet, &bounds, false);

rastSettings.type = kRasterizeRGB;

rastSettings.resolution = 300;

rastSettings.antialiasing = 2;

rastSettings.options = kRasterizeOptionsNone;

error = sAIRasterize->Rasterize(artSet, &rastSettings, &bounds, kPlaceInsideOnTop, layerGroup, &tempRaster, 0);

ai::FilePath ioFilePath(ai::UnicodeString(path));

AIDataFilter* dstfilter = NULL;

AIDataFilter* filter = NULL;

error = sAIDataFilter->NewFileDataFilter(ioFilePath, "write", 'prw', 'ai', &filter);

error = sAIDataFilter->LinkDataFilter(dstfilter, filter);

dstfilter = filter;

 

 

But I don't know what to do next :0

TOPICS
How to, Import and export, Scripting, SDK

Views

20

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Export Art as .ai file

Community Beginner ,
Sep 02, 2020

Copy link to clipboard

Copied

Hello there,

 

I'm actually trying to get the artSet and I want to write .ai file with it ! 

AIArtSet artSet = NULL;

error = sAIArtSet->NewArtSet(&artSet);

sAIArtSet->SelectedArtSet(artSet);


AIRasterizeSettings rastSettings;

AIArtHandle tempRaster = 0;

AIArtHandle layerGroup = 0;

error = sAIArtSet->IndexArtSet(artSet, 0, &layerGroup);

AIRealRect bounds;

error = sAIRasterize->ComputeArtBounds(artSet, &bounds, false);

rastSettings.type = kRasterizeRGB;

rastSettings.resolution = 300;

rastSettings.antialiasing = 2;

rastSettings.options = kRasterizeOptionsNone;

error = sAIRasterize->Rasterize(artSet, &rastSettings, &bounds, kPlaceInsideOnTop, layerGroup, &tempRaster, 0);

ai::FilePath ioFilePath(ai::UnicodeString(path));

AIDataFilter* dstfilter = NULL;

AIDataFilter* filter = NULL;

error = sAIDataFilter->NewFileDataFilter(ioFilePath, "write", 'prw', 'ai', &filter);

error = sAIDataFilter->LinkDataFilter(dstfilter, filter);

dstfilter = filter;

 

 

But I don't know what to do next :0

TOPICS
How to, Import and export, Scripting, SDK

Views

21

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 02, 2020 0

Have something to add?

Join the conversation