External SVGs in Illustrator Variable-Data with Darty-Ai

Illustrator and SVG Interoperability

SVGs have a certain magic: living both in the visual and data worlds. They can be made interactive in the web browser, coded with animations and downloaded to be opened in other applications. Illustrator is one of those applications, and its graphics features are not completely interoperable with the web-based SVG format. It tends to break text into separate characters, and has no idea about Illustrator’s ‘text-frames’ or ‘justification’.

SVG exported from Illustrator using Export-As

<?xml version="1.0" encoding="UTF-8"?>
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
  <g>
    <circle cx="139.213" cy="200.169" r="49.438" fill="#009245"/>
    <path d="M139.213,265.607c-36.083,0-65.438-29.356-65.438-65.439s29.355-65.438,65.438-65.438,65.438,29.355,65.438,65.438-29.355,65.439-65.438,65.439Z" fill="none" stroke="red" stroke-miterlimit="10" stroke-width="20"/>
    <circle cx="139.213" cy="200.169" r="49.438" fill="none" stroke="#000" stroke-miterlimit="10"/>
  </g>
  <path d="M234.719,197.36l136.517-114.607,16.292,194.944,7.303,153.371-98.315-146.629s-160.112,41.573-160.112,37.079,98.315-124.157,98.315-124.157Z" fill="#009245" stroke="#000" stroke-miterlimit="10"/>
  <text transform="translate(39.213 64.393)" font-family="OPTIAlternateThree, OPTIAlternateThree" font-size="40">
  <tspan x="0" y="0">This is an </tspan>
  <tspan x="157.316" y="0" letter-spacing="-.011em">S</tspan>
  <tspan x="176.437" y="0" letter-spacing="-.021em">V</tspan>
  <tspan x="194.716" y="0">G</tspan>
  <tspan x="0" y="48">2nd </tspan>
  <tspan x="66.839" y="48" letter-spacing="-.107em">T</tspan>
  <tspan x="80.279" y="48" letter-spacing="-.021em">e</tspan>
  <tspan x="97.039" y="48">xt Line</tspan></text>
</svg>

Same goes for its warps and effects; only SVG filters may work online, all others would get rasterized, or expanded (in case of vector effects like Offset Path). However, there is one key feature that is well-compatible between the SVG file and Illustrator: the layer-object names. When items are named in the Layers panel in Illustrator, these names make their way to the SVG output. Even more importantly: the reverse acts the same. When an SVG is opened in Illustrator, its id or data-name attributes are brought back as Illustrator object-names.

SVG exported from Illustrator with named line-art

<?xml version="1.0" encoding="UTF-8"?>
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
  <path id="my-shape" d="M234.719,197.36l136.517-114.607,16.292,194.944,7.303,153.371-98.315-146.629s-160.112,41.573-160.112,37.079,98.315-124.157,98.315-124.157Z" fill="#009245" stroke="#000" stroke-miterlimit="10"/>
</svg>

This is precisely where Darty-Ai can take over and make the most use out of external SVGs. With its nameToTags method, all the artwork and its contents brought into Illustrator via the place method get automatically tagged for immediate manipulation via the data.

Sample Demo

Art is named in Layers panel to prepare for tagging via Darty-Ai

Stand-Alone sample Demo Template document This example starts with a very simple Illustrator document: a piece of background artwork and a single foreground shape. The foreground object is labeled my-shape in the Layers panel, and it has also been tagged through the Darty-Ai interface. As a result, the same identifier appears clearly in the Tags panel.

We’ll dynamically replace it with a series of external SVG shapes. From here, we’ll take things a step further. After each shape is placed, we’ll apply color programmatically—demonstrating how both geometry and styling can be driven entirely by data.

Data setup

For the data setup, we organize the spreadsheet into three method groups. The first group handles placing the external SVG into the placeholder and consists of three columns: one for the file reference, and two for placement parameters.

Header setup

AB CD E
my-shape my-shape shape-color
place nameToTags appearance
filepath:shapesclipping:false fit:fit* fillColor

place method

In the Darty-Ai header (row 3), we define a relative folder using the filepath keyword along with the colon (:) to get filepath:shapes (so we don’t need full file paths in the sheet). We also include the parameters clipping:false and fit:fit to ensure the artwork is placed cleanly and scaled proportionally.

nameToTags method

The second group is a single column using the nameToTags method. Once the SVG is placed, this step automatically assigns tags to all nested elements based on their layer names; it's something that works seamlessly because SVG structure is preserved on import.

appearance method

Finally, the third group is another single column that applies styling. Here, we target specific tagged elements from the imported shape and assign a new color using the appearance method, completing the transformation from external geometry to fully styled artwork.

Populating Sample Data

We can now populate the sheet with a few sample rows (three is enough to get started) each referencing one of the SVG files in our shapes folder. The nameToTags column requires no input, as tagging happens automatically after placement. In the color column (the appearance method), however, we assign different values per row. To demonstrate flexibility, we can mix formats: using standard hex codes in some rows and even CMYK values in another, showing how Darty-Ai can interpret multiple color inputs seamlessly.

AB CD E
my-shape my-shape shape-color
place nameToTags appearance
filepath:shapesclipping:false fit:fit* fillColor
shape-1.svg 0 100 100 0
shape-2.svg #F0F
shape-3.svg #00F

External SVG Structure

Our setup includes a shapes folder located alongside the Illustrator template.

Simple SVG artwork document

Each SVG inside was created in Illustrator and contains a single shape tagged with a name such as shape-color. This simple structure makes it easy to test. Once verified, the same approach can be extended to more complex SVGs containing multiple elements.

Testing with Darty Preview

After preparing the data, we import it from Google Sheets, Excel, or even CSV. Activating the Darty preview (via the eye icon) allows us to step through each record. As we do, the placeholder updates dynamically—swapping in the external SVG and applying the assigned color for that row.

Using Multi-Element SVGs

To expand the workflow, we can introduce SVGs that contain multiple shapes. Each element should be uniquely named in Illustrator so that, upon export, those names become usable tags.

Multi-shape SVG artwork structure

Keep in mind that duplicate layer names are automatically suffixed in SVG output, so using clear, intentional naming (e.g., shape-color-b) ensures predictable targeting. Also note that sometimes it’s possible that Illustrator layers get exported as SVG groups, which may appear as “Layer 1” but function simply as grouped elements. It can be leveraged in more advanced setups. With these multi-element SVGs, we can add additional color columns in the spreadsheet to control each part independently. The result is that a single SVG file can generate a wide variety of visual outcomes based purely on data.

Using AI to Generate Data

Once the workflow is stable, modern AI tools can accelerate data creation.

By providing example outputs, such as screenshots and existing color sets, we can prompt an LLM to generate new variations, including color palettes or structured data.

These results can be pasted directly into the spreadsheet, quickly expanding the number of usable records.

Generating spreadsheet data with ChatGPT

Here we provide ChatGPT a list of our SVG files so it knows what data to work with, as well as the current data-body, without the header. This is done because we want to append new rows to the data, without pasting over the entire sheet. It provides back the extra rows which are pasted directly back into the Google Sheet. In future tutorials, we’ll explore how this pairs with lookup tables and reusable datasets for even greater efficiency.

AB CD EF
my-shape my-shape shape-colorshape-color-b
place nameToTags appearanceappearance
filepath:shapesclipping:false fit:fit* fillColorfillColor
shape-1.svg #FF6B6B#F4ECDC4
shape-2.svg #FFD166#118AB2
shape-3.svg #06D6A0#EF476F
shape-4.svg #8338EC#FFBE0B
shape-5.svg #3A86FF#FB5607
shape-6.svg #8AC926#6A4C93
shape-7.svg #FF595E#1982C4
shape-1.svg #F15BB5#00BBF9
shape-2.svg #9B5DE5#00F5D4

The test is performed:
Testing the LLM-generated colors on our shapes.

Conclusion


This demonstrates a foundational workflow: importing external SVGs into Illustrator and modifying their contents through structured data. It’s a powerful approach for variable data applications where consistent structure meets high variation such as: signage systems, apparel design, automotive graphics, and even as a precursor in certain kinds of data-driven 3D asset generation.

Leave a Comment

Scroll to Top