Python API: Копирование объектов между документами

Russian forum
Forum rules
Правила форума и полезная информация

ПОЖАЛУЙСТА! Начиная обсуждение, обязательно....
erohin
Posts: 7
Joined: Tue Jul 07, 2015 2:48 am

Re: Python API: Копирование объектов между документами

Post by erohin »

Пока вижу только одно решение: создание нового объекта с наследованием параметров предыдущего
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Python API: Копирование объектов между документами

Post by DeepSOIC »

питон:
App.ActiveDocument.copyObject()

вырезка из Document.h:
/** Copy an object from another document to this document
* If \a recursive is true then all objects this object depends on
* are copied as well. By default \a recursive is false.
* Returns the copy of the object or 0 if the creation failed.
*/
DocumentObject* copyObject(DocumentObject* obj, bool recursive=false);

/** Move an object from another document to this document
* If \a recursive is true then all objects this object depends on
* are moved as well. By default \a recursive is false.
* Returns the moved object itself or 0 if the object is already part of this
* document..
*/
DocumentObject* moveObject(DocumentObject* obj, bool recursive=false);
erohin
Posts: 7
Joined: Tue Jul 07, 2015 2:48 am

Re: Python API: Копирование объектов между документами

Post by erohin »

Ну вот, а я собрался было велосипед изобретать :lol:
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Python API: Копирование объектов между документами

Post by DeepSOIC »

я вот буквально только что ковырялся в этих исходниках, и тут этот топик всплыл :P
Post Reply