• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Making custom Symbols available by default

Engaged ,
Nov 04, 2016 Nov 04, 2016

Copy link to clipboard

Copied

Since creating placed artwork from an external AI file has proved problematic, I decided to try using Symbols.

Does anyone know how to get symbols into Illustrator's default list, so that they are available to any document? I created my own symbol library, which I can load using the palette, but I can't seem to find a file that I can add my symbols so that they always just appear in the default list.

The "Unlisted" symbols feature also looks promising, since I don't really need the user to see these at all.

I'm not really sure how to go about this. Maybe someone has some experience adding and using custom symbols?

TOPICS
SDK

Views

1.5K

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
community guidelines

correct answers 1 Correct answer

Guide , Nov 04, 2016 Nov 04, 2016

AIDocumentHandle handle = 0;

sPathStyle->ImportStyles(path, &handle);

ai::int32 count = 0;

sSymbol->CountSymbolPatternsFromDocument(&count, handle);

for (ai::int32 i = 0; i < count; i++) {

  AIPatternHandle symbol = 0;

  sSymbol->GetNthSymbolPatternFromDocument(i, &symbol, handle);

AIPatternHandle newStyle = 0;

  sSymbol->RetargetForCurrentDocument(symbol, &newStyle);

}

Votes

Translate

Translate
Adobe
Guide ,
Nov 04, 2016 Nov 04, 2016

Copy link to clipboard

Copied

AIDocumentHandle handle = 0;

sPathStyle->ImportStyles(path, &handle);

ai::int32 count = 0;

sSymbol->CountSymbolPatternsFromDocument(&count, handle);

for (ai::int32 i = 0; i < count; i++) {

  AIPatternHandle symbol = 0;

  sSymbol->GetNthSymbolPatternFromDocument(i, &symbol, handle);

AIPatternHandle newStyle = 0;

  sSymbol->RetargetForCurrentDocument(symbol, &newStyle);

}

Votes

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
community guidelines
Engaged ,
Nov 04, 2016 Nov 04, 2016

Copy link to clipboard

Copied

Looks good. That's almost exactly what I came up with. Except I forgot about the "FromDocument" functions so I was flicking back and forth between them with Activate(..). And I open my source document with DocumentList->Open(...). Is there a reason you choose to create a new document with ImportStyles instead?

Votes

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
community guidelines
Engaged ,
Nov 04, 2016 Nov 04, 2016

Copy link to clipboard

Copied

Weird. It looks like ImportStyles opens the document "silently" so it doesn't show in recent documents or flicker the display as it opens and closes. Very interesting.

Votes

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
community guidelines
Guide ,
Nov 07, 2016 Nov 07, 2016

Copy link to clipboard

Copied

Yeah, I was going to write and tell you that That's not the only 'silent' document function. When you place art, at least for rasters, it also semi-silently does the same thing. I say 'semi-silently' because you get document opened notifiers and I had re-jig my code to ignore them if they didn't exist in the document list. That was a while ago though, so they may have fixed that; it felt like a bug.

Votes

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
community guidelines
Advocate ,
Oct 14, 2021 Oct 14, 2021

Copy link to clipboard

Copied

LATEST

Hi

This looks like it is a script, but how exactly use this, trying to use in Mac Illustrator version 2019

Votes

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
community guidelines
LEGEND ,
Apr 10, 2020 Apr 10, 2020

Copy link to clipboard

Copied

Old thread, but this is something I'm trying to do. I take it this uses Scriptographer. Is it compatible with AI CC 2015 and how do I run it? Do I need to install Scriptographer or is it simply a .JSX? Sorry, I'm clueless.

Votes

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
community guidelines
Community Expert ,
Apr 11, 2020 Apr 11, 2020

Copy link to clipboard

Copied

Scriptographer is a plugin. It's compatible to versions up to CS5.

Into Scriptographer you can then plug scripts. But they won't run without Scriptographer as their base.

Votes

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
community guidelines
LEGEND ,
Apr 15, 2020 Apr 15, 2020

Copy link to clipboard

Copied

So, for all practical purposes it is a "dead" program. I love CS5 but most customers/businesses do not even have it anymore. Thank you for clarifying.

Votes

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
community guidelines