Author Topic: Copy Database Object fail  (Read 1979 times)

0 Members and 1 Guest are viewing this topic.

vario

  • Guest
Copy Database Object fail
« on: January 27, 2012, 01:24:56 AM »
Hi!
I have an opened drawing and i would like to modify it and save it as a new drawing.

this process will be repeated for serveral times.

for example, modify the current drawing, delete layouts, add objects and so on. Save it to a new file and repeat the process.
delete other layouts or create other objects and save it to a new file.

i tried to export each layout in a new drawing but this process only works for the first one i export.
the other files are all damaged...
i think the copy process keeps the reference to the current database and if i want to export another layout which was deleted in the process before the new drawing is damaged...

is there a way to copy the current database several times to modify it without damaging?


Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Copy Database Object fail
« Reply #1 on: January 27, 2012, 03:00:58 AM »

I think you're looking for SaveAS

public void SaveAs(string fileName, DwgVersion version);
 
Declaring Type: Autodesk.AutoCAD.DatabaseServices.Database
Assembly: Acdbmgd, Version=18.2.0.0
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

vario

  • Guest
Re: Copy Database Object fail
« Reply #2 on: January 27, 2012, 05:03:54 AM »
i know the function, but the problem is, if i modify the drawing several times and save it between the operations the first one is correct, the following drawings are corrupt.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Copy Database Object fail
« Reply #3 on: January 27, 2012, 06:16:12 AM »
i know the function, but the problem is, if i modify the drawing several times and save it between the operations the first one is correct, the following drawings are corrupt.

Why and how are the drawings corrupt.

Perhaps you should show us the code.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.