Skip to main content
Known Participant
December 3, 2013
Question

AI Document-View synchronization issue

  • December 3, 2013
  • 1 reply
  • 605 views

My plugin works as following:

1. Delete a layer named "X1"

2. Add a layer "X1" and also add some art on that document

3. RedrawDocument()

4. SyncDocument from AIDocumentSuite

5. Saves changes through code

6. SyncDocument from AIDocumentSuite

7. RedrawDocument from AIDocumentSuite

Redraw at step 3 works fine. but ...redraw at step 7 loads document of state which is during "opening" the document (before step 1 of the above steps).

When I close the document and open again, I can see that the changes have been saved successfully.

A document-reload will be a work-around solution for me right now. But I don't find the reload document function either.

What might be the possible reasons for this document's Redraw failure ?

P.S. : I have used GetDocument() multiple times as a validation to check if any document is open or not. Can this be a problem, if it return a copy of the document for redraw.

This topic has been closed for replies.

1 reply

A. Patterson
Inspiring
December 3, 2013

This will sound stupid, but trying calling RedrawDocument() twice. I've known cases where that was required to make the document redraw.

Beyond that, I don't know why it wouldn't immediatley be reflected. We create layers & art all time and don't have any problems getting the results rendered normally. Granted, we're not usually replacing a layer, but presumably you've tried that workflow with a change to the newly added layer named something like 'X2' instead and that works? Also, do you need to call SyncDocument? We've never had to call that, and in fact the documentation on the function indicates that you shouldn't normally have to.

DatasetAuthor
Known Participant
December 4, 2013

1. The 2 times RedrawDocument() did not help.

2. SyncDocument() has no effect on the issue. I was just being more cautious.

3. Tried renaming the new layer, but still did not help. I tried 1 more thing, deleted the layer, saved document(through code), and redrew the document. The contents of the deleted layer were still visible.

My work-around :

1. Copy file path, color model of document.

2. Close document

3. Open Document using details copied in step 1

This helps but will surely show a big flickring effect in huge documents.