Problem with Save back iusing .NET

Problem with Save back iusing .NET

Anonymous
Not applicable
443 Views
2 Replies
Message 1 of 3

Problem with Save back iusing .NET

Anonymous
Not applicable
I have tried to save back using the method described in the .NET help files.

1. call AttachedDrawing.Lock(false) to lock the dwg file.
2. call AttachedDrawing.CloneBack
3. call AttachedDrawing.Save to commit the canges
4. Call AttachedDrawing.Unlock to unlock the dwg file.

The CloneBack call causes a MapException

The attached dwg's are not updated.

Using the ADESAVEOBJS command works fine and saves any changes to objects back to the dwgs.

Any thought? am I missing some call or setting prior to calling the cloneback method?

Any suggestions would be of help.

Paul
0 Likes
444 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Autodesk has admitted at the CloneBackArea method has a problem and said to use the CloneBack method instead.

The correct sequence for saving back to the attached drawings is slightly different than what was shown above.

for each drawing in the drawing set...
1. use the method "GetNumInSaveSet" to determine if there are entities that are in the saveset and in the drawing. If there are then:
2. call AttachedDrawing.Lock(false) to lock the dwg file.
3. call AttachedDrawing.CloneBack
4. call AttachedDrawing.Save to commit the changes
5. Call AttachedDrawing.Unlock to unlock the dwg file.

Autodesk is currently researching a "work-around" for the clonebackarea method.
0 Likes
Message 3 of 3

gluckett
Collaborator
Collaborator
Hi, I was not sure about that last step:

5. Call AttachedDrawing.Unlock to unlock the dwg file.

because the AttachedDrawing only has:

AttachedDrawing.UnlockForWrite()
and

AttachedDrawing.UnlockForRead()

is this correct?

gordon
0 Likes