Cloning a database from an existing database and retaining dimension styles etc

Cloning a database from an existing database and retaining dimension styles etc

BKSpurgeon
Collaborator Collaborator
625 Views
2 Replies
Message 1 of 3

Cloning a database from an existing database and retaining dimension styles etc

BKSpurgeon
Collaborator
Collaborator

Hi all

 

I am trying to copy certain objects from my current drawing into a new one. I am using the code contained here: https://adndevblog.typepad.com/autocad/2012/09/copying-deepcloning-from-one-drawing-to-another-using...

 

Basically I'm using WblockCloneObjects to copy objects from one drawing to another. But the problem is that the new drawing does not retain all the items contained in the source database: e.g. dimension styles, styling, layers, certain block definitions etc

 

Is there a way to ensure that all of those items are also cloned? In other words, I want the new database exactly the same as the old, except for what appears in the model space - and I have object ids for those items which I want in the model space.

 

Any advice would be much appreciated. Thank you!

 

Ben

0 Likes
Accepted solutions (1)
626 Views
2 Replies
Replies (2)
Message 2 of 3

Alexander.Rivilis
Mentor
Mentor
Accepted solution

It is look like easy to duplicate source dwg-file, open it and erase all entities in ModelSpace.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 3 of 3

_gile
Consultant
Consultant

If you absolutely want to use WblockCloneObjects  (even the route suggested by @Alexander.Rivilis shuld be much mor simple), you have to clone the contents of all tables in the source file to the corresponding table in the destination file.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub