Skip to main content
Rick E Johnson
Inspiring
October 2, 2023
Answered

GetNthSymbolPattern for external symbol library

  • October 2, 2023
  • 2 replies
  • 481 views

Is there a simple way using the SDK in c++ to find other symbol libraries and access symbols in them? That is, select a symbol library from the Symbol panel's flyout menu, and access symbols there.

 

GetNthSymbolPattern only works for the current document, and GetNthSymbolPatternFromDocument won't work because the external symbol library's document is not actually open.

 

Any suggestions would be much appreciated.

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer A. Patterson

The missing piece you're looking for is AIPathStyle::ImportStyles(). That lets you specify a path to an AI document and gives you an AIDocumentHandle that you can use with the GetNthSymbolPatternFromDocument() function.

2 replies

A. Patterson
A. PattersonCorrect answer
Inspiring
October 2, 2023

The missing piece you're looking for is AIPathStyle::ImportStyles(). That lets you specify a path to an AI document and gives you an AIDocumentHandle that you can use with the GetNthSymbolPatternFromDocument() function.

Rick E Johnson
Inspiring
October 2, 2023

Thanks, Andrew, it works perfectly! I wouldn't have expected the answer to be in path styles. At first I wondered if it would open the symbols as another document, but it didn't. I also expected the solution would involve checking each open symbol panel, but that's OK, in this case I need a specific document's symbols.

 

It would be even better if the plugin could now open that document's symbols library in a panel.

 

-- Many thanks!