Skip to main content
2007ay
Known Participant
June 14, 2013
Answered

how to retrieve information stored in dictinory

  • June 14, 2013
  • 1 reply
  • 1831 views

hi ,

I am creating one custom plug - in for my project. and for this i want to create one dictinory.

In this dictinory i want to store my object and one custom prooperty related to this selected object( exp path item, raster item. etc).

i want to know after closing AI CS6 how can i access the same value what i stored in dictinory.

is this possbile ? or is any other way to achive this taks.

actully i want to create one property for the selected item and want to save and retrieve back. this property.

Regards

Ashish Yadav.

This topic has been closed for replies.
Correct answer A. Patterson

I'm not sure I fully understand you.

Dictionaries are found on art objects, layers or on the document itself. You can store anything that a dictionary supports in any of those dictionaries. To retrieve it, you just need to get the same dictionary and know the name of the entry you want. You can even store dictionaries as entries, which can be very convenient for storing complicated structures.

One of the dictionary entry types is 'binary', which means you can store anything at all so long as you do it carefully and take on the responsibility of converting it to a stream of bytes & back properly.

There's a really good example in the CodeSnippets sample project, in SnpDictionary.cpp.

1 reply

A. Patterson
A. PattersonCorrect answer
Inspiring
June 14, 2013

I'm not sure I fully understand you.

Dictionaries are found on art objects, layers or on the document itself. You can store anything that a dictionary supports in any of those dictionaries. To retrieve it, you just need to get the same dictionary and know the name of the entry you want. You can even store dictionaries as entries, which can be very convenient for storing complicated structures.

One of the dictionary entry types is 'binary', which means you can store anything at all so long as you do it carefully and take on the responsibility of converting it to a stream of bytes & back properly.

There's a really good example in the CodeSnippets sample project, in SnpDictionary.cpp.

2007ay
2007ayAuthor
Known Participant
June 19, 2013

Hi Patterson,

Thank a lot for your quick response now I am able to add and retrieve the data.

but one more thing i want to ask I am unable to get the value from the dictinory after reopen the AI.

actully i mean to say :

1) I am creating one dictinory and saving some key pair value .

2) Then close the AI

3) lunch again AI

4) and try to access the old value which is saved in some dictinory

what to do for this ?

Regards

A. Patterson
Inspiring
June 19, 2013

First, where are you trying to store the data? On an art object? A layer? The document?

Second, all three of the above locations already have existing dictionaries, you just need to get the handle to them and add entries. The only time you should be creating a dictionary is if you're creating an entry an existing dictionary that is also a dictionary (i.e. a sub-dictionary).

If you're doing this already, there's probably something simple we're missing, but we'll figure it out. Our plug-in heavily relies on dictionaries so I know they're reliable